Dynamic adjustment of application resources in a distributed computing system

ABSTRACT

A new snapshot of a storage volume is created by instructing computing nodes to suppress write requests. Once pending write requests from the computing nodes are completed, storage nodes create a new snapshot for the storage volume by allocating a new segment to the new snapshot and finalizes and performs garbage collection with respect to segments allocated to the previous snapshot. Subsequent write requests to the storage volume are then performed on the segments allocated to the new snapshot. An orchestration layer implements a bundled application that is provisioned with virtualized storage and computation resources. A snapshot of the application may be created and used to rollback or clone the application. The amount of processing cores, memory, and containers of the bundled application may be increased or decreased based on usage. Components of the bundled application may be assigned to nodes to satisfy affinity and anti-affinity rules.

BACKGROUND

Field of the Invention

This invention relates to orchestration of roles in an applicationinstantiated in a distributed storage and computation system.

Background of the Invention

In many contexts, it is helpful to be able to return a database to anoriginal state or some intermediate state. In this manner, changes tosoftware or other database configuration parameters may be testedwithout fear of corrupting critical data.

The systems and methods disclosed herein provide an improved approachfor creating snapshots of a database and returning to a previoussnapshot.

BRIEF DESCRIPTION OF THE DRAWINGS

In order that the advantages of the invention will be readilyunderstood, a more particular description of the invention brieflydescribed above will be rendered by reference to specific embodimentsillustrated in the appended drawings. Understanding that these drawingsdepict only typical embodiments of the invention and are not thereforeto be considered limiting of its scope, the invention will be describedand explained with additional specificity and detail through use of theaccompanying drawings, in which:

FIG. 1 is a schematic block diagram of a network environment forimplementing methods in accordance with an embodiment of the presentinvention;

FIG. 2 is a process flow diagram of a method for coordinating snapshotcreation with compute nodes and storage nodes in accordance with anembodiment of the present invention;

FIG. 3 is a schematic diagram illustrating the storage of data within astorage node in accordance with an embodiment of the present invention;

FIG. 4 is a process flow diagram of a method for processing writerequests in a storage node in accordance with an embodiment of thepresent invention;

FIG. 5 is a process flow diagram of a method for processing a snapshotinstruction by a storage node in accordance with an embodiment of thepresent invention;

FIG. 6 is a process flow diagram of a method for performing garbagecollection on segments in accordance with an embodiment of the presentinvention;

FIG. 7 is a process flow diagram of a method for reading data from asnapshot in accordance with an embodiment of the present invention;

FIG. 8 is a process flow diagram of a method for cloning a snapshot inaccordance with an embodiment of the present invention;

FIG. 9 illustrates a snapshot hierarchy created in accordance with anembodiment of the present invention;

FIG. 10 is a process flow diagram of a method for rolling back to aprior snapshot in accordance with an embodiment of the presentinvention;

FIG. 11 illustrates the snapshot hierarchy of FIG. 9 as modifiedaccording to the method of FIG. 10 in accordance with an embodiment ofthe present invention;

FIG. 12 is a process flow diagram of a method for reading from a clonesnapshot in accordance with an embodiment of the present invention;

FIG. 13 is a schematic block diagram of components for implementingorchestration of multi-role applications in accordance with anembodiment of the present invention;

FIG. 14 is a process flow diagram of a method for orchestrating thedeployment of a multi-role application in accordance with an embodimentof the present invention;

FIG. 15 is a process flow diagram of a method for implementingprovisioning constraints in accordance with an embodiment of the presentinvention;

FIG. 16 is a process flow diagram of a method for creating a snapshot ofa multi-role application in accordance with an embodiment of the presentinvention;

FIG. 17 is a process flow diagram of a method for rolling back amulti-role application in accordance with an embodiment of the presentinvention;

FIG. 18 is a diagram illustrating the use of a layered file system toimprove application portability in accordance with an embodiment of thepresent invention;

FIG. 19 is a process flow diagram of a method for creating and moving aportable application in accordance with an embodiment of the presentinvention;

FIG. 20 is a process flow diagram of a method for testing a distributedapplication in accordance with an embodiment of the present invention;

FIG. 21 is a schematic block diagram of components of a storage node inaccordance with an embodiment of the present invention;

FIG. 22 is a process flow diagram of a method for assigning storagevolumes to a disk of a storage node in accordance with an embodiment ofthe present invention;

FIG. 23 is a process flow diagram of a method for managing storagevolumes of a bundled application in accordance with an embodiment of thepresent invention;

FIG. 24 is a schematic block diagram of data structures for managing anumber of volumes per disk in accordance with an embodiment of thepresent invention;

FIG. 25 is a process flow diagram of a method for managing the number ofvolumes per disk in accordance with an embodiment of the presentinvention;

FIG. 26 is a process flow diagram of a method for scaling out anapplication in accordance with an embodiment of the present invention;

FIG. 27 is a process flow diagram of a method for increasing computingresources for an application in accordance with an embodiment of thepresent invention;

FIG. 28 is a diagram illustrating an approach for virtualizing systemresource data in accordance with an embodiment of the present invention;

FIG. 29 is a process flow diagram of a method for virtualizing systemresource data in accordance with an embodiment of the present invention;

FIG. 30 is a process flow diagram of a method for providing provisioningsuggestions according to a topology of a distributed computing system inaccordance with an embodiment of the present invention;

FIG. 31 is a process flow diagram of a method for adding a storagevolume to an application in accordance with an embodiment of the presentinvention;

FIG. 32 is a process flow diagram of a method for assigning storagevolumes to storage devices in a distributed computing system inaccordance with an embodiment of the present invention;

FIG. 33 is a process flow diagram of a method for implementingassignment of addresses to components of a bundled application inaccordance with an embodiment of the present invention; and

FIG. 34 is a schematic block diagram of an example computing devicesuitable for implementing methods in accordance with embodiments of theinvention.

DETAILED DESCRIPTION

Referring to FIG. 1, the methods disclosed herein may be performed usingthe illustrated network environment 100. The network environment 100includes a storage manager 102 that coordinates the creation ofsnapshots of storage volumes and maintains records of where snapshotsare stored within the network environment 100. In particular, thestorage manager 102 may be connected by way of a network 104 to one ormore storage nodes 106, each storage node having one or more storagedevices 108, e.g. hard disk drives, flash memory, or other persistent ortransitory memory. The network 104 may be a local area network (LAN),wide area network (WAN), or any other type of network including wired,fireless, fiber optic, or any other type of network connections.

One or more compute nodes 110 are also coupled to the network 104 andhost user applications that generate read and write requests withrespect to storage volumes managed by the storage manager 102 and storedwithin the memory devices 108 of the storage nodes 108.

The methods disclosed herein ascribe certain functions to the storagemanager 102, storage nodes 106, and compute node 110. The methodsdisclosed herein are particularly useful for large scale deploymentincluding large amounts of data distributed over many storage nodes 106and accessed by many compute nodes 110. However, the methods disclosedherein may also be implemented using a single computer implementing thefunctions ascribed herein to some or all of the storage manager 102,storage nodes 106, and compute node 110.

Referring to FIG. 2, the illustrated method 200 may be performed inorder to invoke the creation of a new snapshot. Other than a currentsnapshot, which is still subject to change, a snapshot captures thestate of a storage volume at a moment in time and is preferably notaltered in response to subsequent writes to the storage volume.

The method 200 includes receiving, by the storage manager 102 a requestto create a new snapshot for a storage volume. A storage volume asreferred to herein may be a virtual storage volume that may divided intoindividual slices. For example, storage volumes as described herein maybe 1 TB and be divided into 1 GB slices. In general, a slice and itssnapshot are stored on a single storage node 106, whereas a storagevolume may have the slices thereof stored by multiple storage nodes 106.

The request received at step 202 may be received from a human operatoror generated automatically, such as according to backup schedulerexecuting on the storage manager 102 or some other computing device. Thesubsequent steps of the method 200 may be executed in response toreceiving 202 the request

The method 200 may include transmitting 204 a quiesce instruction to allcompute nodes 110 that are associated with the storage volume. Forexample, all compute nodes 110 that have pending write requests to thestorage volume. In some embodiments, the storage manager 102 may store amapping of compute nodes 110 to a particular storage volume used by thecompute nodes 110. Accordingly, step 204 may include sending 204 thequiesce instruction to all of these compute nodes. Alternatively, theinstruction may be transmitted 204 to all compute nodes 110 and includean identifier of the storage volume. The compute nodes 110 may thensuppress any write instructions referencing that storage volume.

The quiesce instruction instructs the compute nodes 110 that receive itto suppress 206 transmitting write requests to the storage nodes 106 forthe storage volume referenced by the quiesce instruction. The quiesceinstruction may further cause the compute nodes 110 that receive it toreport 208 to the storage manager 102 when no write requests are pendingfor that storage volume, i.e. all write requests issued to one or morestorage nodes 106 and referencing slices of that storage volume havebeen acknowledged by the one or more storage nodes 106.

In response to receiving the report of step 208 from one or more computenodes, e.g. all compute nodes that are mapped to the storage node thatis the subject of the snapshot request of step 202, the storage manager102 transmits 210 an instruction to the storage nodes 106 associatedwith the storage volume to create a new snapshot of that storage volume.Step 210 may further include transmitting 210 an instruction to thecompute nodes 110 associated with the storage volume to commence issuingwrite commands to the storage nodes 106 associated with the storagevolume. In some embodiments, the instruction of step 110 may include anidentifier of the new snapshot. Accordingly, subsequent input/outputoperations (IOPs) transmitted 214 from the compute nodes may referencethat snapshot identifier. Likewise, the storage node 106 may associatethe snapshot identifier with data subsequently written to the storagevolume, as described in greater detail below.

In response to receiving 210 the instruction to create a new snapshot,each storage node 106 finalizes 212 segments associated with the currentsnapshot, which may include performing garbage collection, as describedin greater detail below. In addition, subsequent IOPs received by thestorage node may also be processed 216 using the new snapshot as thecurrent snapshot, as is also described in greater detail below.

Referring to FIG. 3, the method by which slices are allocated,reassigned, written to, and read from may be understood with respect tothe illustrated data storage scheme. The data of the storage scheme maybe stored in transitory or persistent memory of the storage node 106,such as in the storage devices 108.

For each logical volume, the storage manager 102 may store and maintaina volume map 300. For each slice in the logical volume, the volume mapmay include an entry including a node identifier 302 identifying thestorage node 106 to which the slice is assigned and an offset 304 withinthe logical volume at which the slice begins. In some embodiments,slices are assigned both to a storage node 106 and a specific storagedevice hosted by the storage node 106. Accordingly, the entry mayfurther include a disk identifier of the storage node 106 referencingthe specific storage device to which the slice is assigned.

The remaining data structures of FIG. 3 are stored on each storage node106. The storage node 106 may store a slice map 308. The slice map 308may include entries including a local slice identifier 310 that uniquelyidentifies each slice of the storage node 106, e.g. each slice of eachstorage device hosted by the storage node 106. The entry may furtherinclude a volume identifier 312 that identifies the logical volume towhich the local slice identifier 310 is assigned. The entry may furtherinclude the offset 304 within the logical volume of the slice of thelogical volume assigned to the storage node 106.

In some embodiments, an entry in the slice map 308 is created for aslice of the logical volume only after a write request is received thatreferences the offset 304 for that slice. This further supports theimplementation of overprovisioning such that slices may be assigned to astorage node 106 in excess of its actual capacity since the slice isonly tied up in the slice map 308 when it is actually used.

The storage node 106 may further store and maintain a segment map 314.The segment map 314 includes entries either including or correspondingto a particular physical segment identifier (PSID) 316. For example, thesegment map 314 may be in an area of memory such that each address inthat area corresponds to one PSID 316 such that the entry does notactually need to include the PSID 316. The entries of the segment map314 may further include a slice identifier 310 that identifies a localslice of the storage node 106 to which the PSID 316 has been assigned.The entry may further include a virtual segment identifier (VSID) 318.As described in greater detail below, each time a segment is assigned tological volume and a slice of a logical volume, it may be assigned aVSID 318 such that the VSIDs 318 increase in value monotonically inorder of assignment. In this manner, the most recent PSID 316 assignedto a logical volume and slice of a logical volume may easily bedetermined by the magnitude of the VSIDs 318 mapped to the PSIDs 316. Insome embodiments, VSIDs 318 are assigned in a monotonically increasingseries for all segments assigned to volume ID 312. In other embodiments,each offset 304 and its corresponding slice ID 310 is assigned VSIDsseparately, such that each slice ID 310 has its own corresponding seriesof monotonically increasing VSIDs 318 assigned to segments allocated tothat slice ID 310.

The entries of the segment map 314 may further include a data offset 320for the PSID 316 of that entry. As described in greater detail below,when data is written to a segment it may be written at a first openposition from a first end of the segment. Accordingly, the data offset320 may indicate the location of this first open position in thesegment. The data offset 320 for a segment may therefore be updated eachtime data is written to the segment to indicate where the new first openposition is.

The entries of the segment map 314 may further include a metadata offset322. As described in detail below, for each write request written to asegment, a metadata entry may be stored in that segment at a first openposition from a second end of the segment opposite the first end.Accordingly, the metadata offset 322 in an entry of the segment map 314may indicate a location of this first open position of the segmentcorresponding to the entry.

Each PSID 316 corresponds to a physical segment 324 on a device hostedby the storage node 106. As shown, data payloads 326 from various writerequests are written to the physical segment 324 starting from a firstend (left) of the physical segment. The physical segment may furtherstore index pages 328 such that index pages are written starting from asecond end (right) of the physical segment 324.

Each index page 328 may include a header 330. The header 330 may becoded data that enables identification of a start of an index page 328.The entries of the index page 328 each correspond to one of the datapayloads 326 and are written in the same order as the data payloads 326.Each entry may include a logical block address (LBA) 332. The LBA 332indicates an offset within the logical volume to which the data payloadcorresponds. The LBA 332 may indicate an offset within a slice of thelogical volume. For example, inasmuch as the PSID 316 is mapped to aslice ID 310 that is mapped to an offset 304 within a particular volumeID 312, maps 308 and 314, and an LBA 332 within the slice may be mappedto the corresponding offset 304 to obtain a fully resolved addresswithin the logical volume.

In some embodiments, the entries of the index page 328 may furtherinclude a physical offset 334 of the data payload 326 corresponding tothat entry. Alternatively or additionally, the entries of the index page328 may include a size 336 of the data payload 326 corresponding to theentry. In this manner, the offset to the start of a data payload 326 foran entry may be obtained by adding up the sizes 336 of previouslywritten entries in the index pages 328.

The metadata offset 322 may point to the last index page 328 (furthestfrom right in illustrated example) and may further point to the firstopen entry in the last index page 328. In this manner, for each writerequest, the metadata entry for that request may be written to the firstopen position in the last index page 328. If all of the index pages 328are full, a new index page 328 may be created and stored at the firstopen position from the second end and the metadata for the write requestmay be added at the first open position in that index page 328.

The storage node 106 may further store and maintain a block map 338. Ablock map 338 may be maintained for each logical volume and/or for eachslice offset of each logical volume, e.g. for each local slice ID 310which is mapped to a slice offset and logical volume by slice map 308.The entries of the block map 338 map include entries corresponding toeach LBA 332 within the logical volume or slice of the logical volume.The entries may include the LBA 332 itself or may be stored at alocation within the block map corresponding to an LBA 332.

The entry for each LBA 332 may include the PSID 316 identifying thephysical segment 324 to which a write request referencing that LBA waslast written. In some embodiments, the entry for each LBA 332 mayfurther indicate the physical offset 334 within that physical segment324 to which the data for that LBA was written. Alternatively, thephysical offset 324 may be obtained from the index pages 328 of thatphysical segment. As data is written to an LBA 332, the entry for thatLBA 332 may be overwritten to indicate the physical segment 324 andphysical offset 334 within that segment 324 to which the most recentdata was written.

In embodiments implementing multiple snapshots for a volume and slice ofa volume, the segment map 314 may additionally include a snapshot ID 340identifying the snapshot to which the PSID 316 has been assigned. Inparticular, each time a segment is allocated to a volume and slice of avolume, the current snapshot identifier for that volume and slice of avolume will be included as the snapshot ID 340 for that PSID 316.

In response to an instruction to create a new snapshot for a volume andslice of a volume, the storage node 106 will store the new currentsnapshot identifier, e.g. increment the previously stored currentsnapshot ID 340, and subsequently allocated segments will include thecurrent snapshot ID 340. PSIDs 316 that are not filled and are allocatedto the previous snapshot ID 340 may no longer be written to. Instead,they may be finalized or subject to garbage collection (see FIGS. 5 and6).

FIG. 4 illustrates a method 400 for executing write instructions by astorage node 106, such as write instructions received from anapplication executing on a compute node 110.

The method 400 includes receiving 402 a write request. The write requestmay include payload data, payload data size, and an LBA as well asfields such as a slice identifier, a volume identifier, and a snapshotidentifier. Where a slice identifier is included, the LBA may be anoffset within the slice, otherwise the LBA may be an address within thestorage volume.

The method 400 may include evaluating 404 whether a PSID 316 isallocated to the snapshot referenced in the write request and whetherthe physical segment 324 corresponding to the PSID 316 (“the currentsegment”) has space for the payload data. In some embodiments, as writerequests are performed with respect to a PSID 316, the amount of datawritten as data 326 and index pages 328 may be tracked, such as by wayof the data offset 320 and metadata offset 322 pointers. Accordingly, ifthe amount of previously-written data 326 and the number of allocatedindex pages 328 plus the size of the payload data and its correspondingmetadata entry exceeds the capacity of the current segment it may bedetermined to be full at step 404.

If the current segment is determined 404 to be full, the method 400 mayinclude allocating 406 a new PSID 316 as the current PSID 316 and itscorresponding physical segment 324 as the current segment for thesnapshot referenced in the write request. In some embodiments, thestatus of PSIDs 316 of the physical storage devices 108 may be flaggedin the segment map 314 as allocated or free as a result of allocationand garbage collection, which is discussed below. Accordingly, a freePSID 316 may be identified in the segment map 314 and flagged asallocated.

The segment map 314 may also be updated 408 to include a slice ID 310and snapshot ID 340 mapping the current PSID 316 to the snapshot ID,volume ID 312, and offset 304 included in the write request. Uponallocation, the current PSID 316 may also be mapped to a VSID (virtualsegment identifier) 318 that will be a number higher than previouslyVSIDs 318 such that the VSIDs increase monotonically, subject, ofcourse, to the size limit of the field used to store the VSID 318.However, the size of the field may be sufficiently large that it is notlimiting in most situations.

The method 400 may include writing 410 the payload data to the currentsegment. As described above, this may include writing 410 payload data326 to the free location closest to the first end of the currentsegment.

The method 400 may further include writing 412 a metadata entry to thecurrent segment. This may include writing the metadata entry (LBA, size)to the first free location closest to the second end of the currentsegment. Alternatively, this may include writing the metadata entry tothe first free location in an index page 328 that has room for it orcreating a new index page 328 located adjacent a previous index page328. Steps 410, 412 may include updating one or more pointers or tablethat indicates an amount of space available in the physical segment,such as a pointer 320 to the first free address closest to the first endand a pointer 322 to the first free address closest to the second end,which may be the first free address before the last index page 328and/or the first free address in the last index page. In particular,these pointers may be maintained as the data offset 320 and metadataoffset in the segment map 314 for the current PSID 316.

The method 400 may further include updating 416 the block map 338 forthe current snapshot. In particular, for each LBA 332 referenced in thewrite request, an entry in the block map 338 for that LBA 332 may beupdated to reference the current PSID 316. A write request may write toa range of LBAs 332. Accordingly, the entry for each LBA 332 in thatrange may be updated to refer to the current PSID 316.

Updating the block map 338 may include evaluating 414 whether an entryfor a given LBA 332 referenced in the write request already exists inthe block map 338. If so, then that entry is overwritten 418 to refer tothe current PSID 316. If not, an entry is updated 416 in the block map318 that maps the LBA 332 to the current PSID 316. In this manner, theblock map 338 only references LBAs 332 that are actually written to,which may be less than all of the LBAs 332 of a storage volume or slice.In other embodiments, the block map 338 is of fixed size and includesand entry for each LBA 332 regardless of whether it has been written topreviously. The block map 338 may also be updated to include thephysical offset 334 within the current segment to which the data 326from the write request was written.

In some embodiments, the storage node 106 may execute multiple writerequests in parallel for the same LBA 332. Accordingly, it is possiblethat a later write can complete first and update the block map 338whereas a previous write request to the same LBA 332 completes later.The data of the previous write request is therefore stale and the blockmap 338 should not be updated.

Suppressing of updating the block map 338 may be achieved by using theVSIDs 318 and physical offset 334. When executing a write request for anLBA, the VSID 318 mapped to the segment 324 and the physical offset 334to which the data is to be, or was, written may be compared to the VSID318 and offset 334 corresponding to the entry in the block map 338 forthe LBA 332. If the VSID 318 mapped in the segment map 314 to the PSID316 in the entry of the block map 338 corresponding to the LBA 332, thenthe block map 338 will not be updated. Likewise, if the VSID 318corresponding to the PSID 316 in the block map 338 is the same as theVSID 318 for the write request and the physical offset 334 in the blockmap 338 is higher than the offset 334 to which the data of the writerequest is to be or was written, the block map 338 will not be updatedfor the write request.

As a result of steps 414-418, the block map 338 only lists the PSID 316where the valid data for a given LBA 332 is stored. Accordingly, onlythe index pages 328 of the physical segment 324 mapped to the PSID 316listed in the block map 338 need be searched to find the data for agiven LBA 332. In instances where the physical offset 334 is stored inthe block map 338, no searching is required.

FIG. 5 illustrates a method 500 executed by a storage node 106 inresponse to the new snapshot instruction of step 210 for a storagevolume. The method 500 may be executed in response to an explicitinstruction to create a new snapshot or in response to a write requestthat includes a new snapshot ID 340. The method 500 may also be executedwith respect to a current snapshot that is still being addressed by newwrite requests. For example, the method 500 may be executed periodicallyor be triggered based on usage.

The method 500 may include allocating 502 a new PSID 316 and itscorresponding physical segment 324 as the current PSID 316 and currentsegment for the storage volume, e.g., by including a slice ID 310corresponding to a volume ID 312 and offset 304 included in the newsnapshot instruction or the write request referencing the new snapshotID 340. Allocating 502 a new segment may include updating 504 an entryin the segment map 314 that maps the current PSID 316 to the snapshot ID340 and a slice ID 310 corresponding to a volume ID 312 and offset 304included in the new snapshot instruction.

As noted above, when a PSID 316 is allocated, the VSID 318 for that PSID316 may be a number higher than all VSIDs 318 previously assigned tothat volume ID 312, and possibly to that slice ID 310 (where slices haveseparate series of VSIDs 318). The snapshot ID 340 of the new snapshotmay be included in the new snapshot instruction or the storage node 106may simply assign a new snapshot ID that is the previous snapshot ID 340plus one.

The method 500 may further include finalizing 506 and performing garbagecollection with respect to PSIDs 316 mapped to one or more previoussnapshots IDs 340 for the volume ID 312 in the segment map 314, e.g.,PSIDs 316 assigned to the snapshot ID 340 that was the current snapshotimmediately before the new snapshot instruction was received.

FIG. 6 illustrates a method 600 for finalizing and performing garbagecollection with respect to segment IDs 340 for a snapshot (“the subjectsnapshot”), which may include the current snapshot or a previoussnapshot. The method 600 may include marking 602 as valid latest-writtendata for an LBA 332 in the PSID 316 having the highest VSID 318 in thesegment map 314 and to which data was written for that LBA 332. Marking602 data as valid may include making an entry in a separate table thatlists the location of valid data or entries for metadata in a givenphysical segment 324 or setting a flag in the metadata entries stored inthe index pages 328 of a physical segment 324, e.g., a flag thatindicates that the data referenced by that metadata is invalid or valid.

Note that the block map 338 records the PSID 316 for the latest versionof the data written to a given LBA 332. Accordingly, any references tothat LBA 332 in the physical segment 324 of a PSID 316 mapped to alower-numbered VSID 318 may be marked 604 as invalid. For the physicalsegment 324 of the PSID 316 in the block map 338 for a given LBA 332,the last metadata entry for that LBA 332 may be found and marked asvalid, i.e. the last entry referencing the LBA 332 in the index page 328that is the last index page 328 including a reference to the LBA 332.Any other references to the LBA 332 in the physical segment 324 may bemarked 604 as invalid. Note that the physical offset 334 for the LBA 332may be included in the block map 334, so all metadata entries notcorresponding to that physical offset 334 may be marked as invalid.

The method 600 may then include processing 606 each segment ID S of thePSIDs 316 mapped to the subject snapshot according to steps 608-620. Insome embodiments, the processing of step 606 may exclude a current PSID316, i.e. the last PSID 302 assigned to the subject snapshot. Asdescribed below, garbage collection may include writing valid data froma segment to a new segment. Accordingly, step 606 may commence with thePSID 316 having the lowest-valued VSID 318 for the subject snapshot. Asany segments 324 are filled according to the garbage collection process,they may also be evaluated to be finalized or subject to garbagecollection as described below.

The method 600 may include evaluating 608 whether garbage collection isneeded for the segment ID S. This may include comparing the amount ofvalid data in the physical segment 324 for the segment ID S to athreshold. For example, if only 40% of the data stored in the physicalsegment 324 for the segment ID S has been marked valid, then garbagecollection may be determined to be necessary. Other thresholds may beused, such as value between 30% and 80%. In other embodiments, theamount of valid data is compared to the size of the physical segment324, e.g., the segment ID S is determined to need garbage collection ifthe amount of valid data is less than X % of the size of the physicalsegment 324, where X is a value between 30 and 80, such as 40.

If garbage collection is determined 608 not to be needed, the method 600may include finalizing 610 the segment ID S. Finalizing may includeflagging the segment ID S in the segment map 314 as full and no longeravailable to be written to. This flag may be stored in another tablethat lists finalized PSIDs 316.

If garbage collection is determined 608 to be needed, then the method600 may include writing 612 the valid data to a new segment. Forexample, if the valid data may be written to a current PSID 316, i.e.the most-recently allocated PSID 316 for the subject snapshot, until itscorresponding physical segment 324 full. If there is no room in thephysical segment 324 for the current PSID 316, step 612 may includeassigning a new PSID 316 as the current PSID 316 for the subjectsnapshot. The valid data, or remaining valid data, may then be writtento the physical segment 324 corresponding to the current PSID 316 forthe subject snapshot.

Note that writing 612 the valid data to the new segment maybe processedin the same manner as for any other write request (see FIG. 4) exceptthat the snapshot ID used will be the snapshot ID 340 of the subjectsnapshot, which may not be the current snapshot ID. In particular, themanner in which the new PSID 316 is allocated to the subject snapshotmay be performed in the same manner described above with respect tosteps 406-48 of FIG. 4. Likewise, the manner in which the valid data iswritten to the current segment may be performed in the same manner asfor steps 410-412 of FIG. 4. In some embodiments, writing of valid datato a new segment as part of garbage collection may also include updatingthe block map with the new location of the data for an LBA 332, such asaccording to steps 414-418 of FIG. 4. When the physical segment 324 ofthe current PSID 316 is found to be full, it may itself be subject tothe process 600 by which it is finalized or subject to garbagecollection.

After the valid data is written to a new segment, the method 600 mayfurther include freeing 614 the PSID S in the segment map 314, e.g.,marking the entry in segment map 314 corresponding to PSID S as free.

The process of garbage collection may be simplified for PSIDs 316 thatare associated with the subject snapshot in the segment map 314 but arenot listed in the block map 338 with respect to any LBA 332. Thephysical segments 324 of such PSIDs 316 do not store any valid data.Entries for such PSIDs 316 in the segment map 314 may therefore simplybe deleted and marked as free in the segment map 314

FIG. 7 illustrates a method 700 that may be executed by a storage node106 in response to a read request. The read request may be received froman application executing on a compute node 110. The read request mayinclude such information as a snapshot ID, volume ID (and/or slice ID),LBA, and size (e.g. number of 4 KB blocks to read).

The following steps of the method 700 may be initially executed usingthe snapshot ID 340 included in the read request as “the subjectsnapshot,” i.e., the snapshot that is currently being processed tosearch for requested data. The method 700 includes receiving 702 theread request by the storage node 106 and identifying 704 one or morePSIDs 316 in the segment map 314 assigned to the subject snapshot andsearching 706 the metadata entries for these PSIDs 316 for references tothe LBA 332 included in the read request.

The searching of step 706 may be performed in order of decreasing VSID318, i.e. such that the metadata entries for the last allocated PSID 316is searched first. In this manner, if reference to the LBA 332 is found,the metadata of any previously-allocated PSIDs 316 does not need to besearched.

Searching 706 the metadata for a PSID 316 may include searching one ormore index pages 328 of the physical segment 324 corresponding to thePSID 316. As noted above, one or more index pages 328 are stored at thesecond end of the physical segment 324 and entries are added to theindex pages 328 in the order they are received. Accordingly, thelast-written metadata including the LBA 332 in the last index page 328(furthest from the second end of the physical segment 324) in which theLBA 332 is found will correspond to the valid data for that LBA 332. Tolocate the data 326 corresponding to the last-written metadata for theLBA 332 in the physical segment 324, the sizes 336 for allpreviously-written metadata entries may be summed to find a startaddress in the physical segment 324 for the data 326. Alternatively, ifthe physical offset 334 is included, then the data 326 corresponding tothe metadata may be located without summing the sizes 336.

If reference to the LBA 332 is found 708 in the physical segment 324 forany of the PSIDs 316 allocated to the subject snapshot, the data 326corresponding to the last-written metadata entry including that LBA 332in the physical segment 324 mapped to the PSID 316 having the highestVSID 318 of all PSIDs 316 in which the LBA is found will be returned 710to the application that issued the read request.

If the LBA 332 is not found in the metadata entries for any of the PSIDs316 mapped to subject snapshot, the method 700 may include evaluating712 whether the subject snapshot is the earliest snapshot for thestorage volume of the read request on the storage node 106. If so, thenthe data requested is not available to be read and the method 700 mayinclude returning 714 a “data not found” message or otherwise indicatingto the requesting application that the data is not available.

If an earlier snapshot than the subject snapshot is present for thestorage volume on the storage node 106, e.g., there exists at least onePSID 316 mapped to a snapshot ID 340 that is lower than the snapshot ID340 of the subject snapshot ID, then the immediately preceding snapshotID 340 will be set 716 to be the subject snapshot and processing willcontinue at step 704, i.e. the PSIDs 316 mapped to the subject snapshotwill be searched for the LBA 332 in the read request as described above.

The method 700 is particularly suited for reading data from snapshotsother than the current snapshot that is currently being written to. Inthe case of a read request from the current snapshot, the block map 338may map each LBA 332 to the PSID 316 in which the valid data for thatLBA 332 is written. Accordingly, for such embodiments, step 704 mayinclude retrieving the PSID 332 for the LBA 332 in the write requestfrom the block map 338 and only searching 706 the metadata correspondingto that PSID 316. Where the block map 338 stores a physical offset 334,then the data is retrieved from that physical offset within the physicalsegment 314 of the PSID 336 mapped to the LBA 332 of the read request.

In some embodiments, the block map 332 may be generated for a snapshotother than the current snapshot in order to facilitate executing readrequests, such as where a large number of read requests are anticipatedin order to reduce latency. This may include searching the index pages328 of the segments 324 allocated to the subject snapshot and itspreceding snapshots to identify, for each LBA 332 to which data has beenwritten, the PSID 316 having the highest VSID 318 of the PSIDs 316having physical segments 324 storing data written to the each LBA 332.This PSID 316 may then be written to the block map 318 for the each LBA332. Likewise, the physical offset 334 of the last-written data for thatLBA 332 within the physical segment 324 for that PSID 316 may beidentified as described above (e.g., as described above with respect tosteps 704-716).

Referring to FIG. 8, in some instances it may be beneficial to clone astorage volume. This may include capturing a current state of aprincipal copy of a storage volume and making changes to it withoutaffecting the principal copy of the storage volume. For purposes of thisdisclosure a “principal copy” or “principal snapshot” of a storagevolume refers to an actual production copy that is part of a series ofsnapshots that is considered by the user to be the current, official, ormost up-to-date copy of the storage volume. In contrast, a clonesnapshot is a snapshot created for experimentation or evaluation butchanges to it are not intended by the user to become part of theproduction copy of the storage volume. Stated differently, only onesnapshot may be a principal snapshot with respect to an immediatelypreceding snapshot, independent of the purpose of the snapshot. Anyother snapshots that are immediate descendants of the immediatelypreceding snapshot are clone snapshots.

The illustrated method 800 may be executed by the storage manager 102and one or more storage nodes 106 in order to implement thisfunctionality. The method 800 may include receiving 802 a cloneinstruction and executing the remaining steps of the method 800 inresponse to the clone instruction. The clone instruction may be receivedby the storage manager 102 from a user or be generated according to ascript or other program executing on the storage manager 102 or a remotecomputing device in communication with the storage manager 102.

The method 800 may include recording 804 a clone branch in a snapshottree. For example, referring to FIG. 9, in some embodiments, for eachsnapshot that is created for a storage volume, the storage manager 102may create a node S1-S5 in a snapshot hierarchy 900. In response to aclone instruction, the storage manager 102 may create a clone snapshotand branch to a node A1 representing the clone snapshot. In theillustrated example, a clone instruction was received with respect tothe snapshot of node S2. This resulted in the creation of clone snapshotrepresented by node A1 that branches from node S2. Note node S3 and itsdescendants are also connected to node S2 in the hierarchy.

In some embodiments, the clone instruction may specify which snapshotthe clone snapshot is of In other embodiments, the clone instruction maybe inferred to be a snapshot of a current snapshot. In such embodiments,a new principal snapshot may be created and become the current snapshot.The previous snapshot will then be finalized and be subject to garbagecollection as described above. The clone will then branch from theprevious snapshot. In the illustrated example, if node S2 representedthe current snapshot, then a new snapshot represented by node S3 wouldbe created. The snapshot of node S2 would then be finalized and subjectto garbage collection and clone snapshot represented by A1 would becreated and node A1 would be added to the hierarchy as a descendent ofnode S2.

In some embodiments, the clone node A1, and possibly its descendants A2to A4 (representing subsequent snapshots of the clone snapshot), may bedistinguished from the nodes S1 to S5 representing principal snapshots,such as by means of a flag, a classification of the connection betweenthe node A1 and node S2 that is its immediate ancestor, or by storingdata defining node A1 in a separate data structure.

Following creation of a clone snapshot, other principal snapshots of thestorage volume may be created and added to represented in the hierarchyby one or more nodes S2 to S5. A clone may be created of any of thesesnapshots and represented by additional clone nodes. In the illustratedexample, node B1 represents a clone snapshot of the snapshot representedby node S4. Subsequent snapshots of the clone snapshot are representedby nodes B1 to B3.

Referring again to FIG. 8, the creation of a clone snapshot on thestorage node 106 may be performed in the identical manner as for anyother snapshot, such as according to the methods of FIGS. 2 through 6.In particular, one or more segments 806 may be allocated to the clonesnapshot on storage nodes 106 storing slices of the cloned storagevolume and mapped to the clone snapshot. IOPs referencing the clonesnapshot may be executed 808, such as according to the method 400 ofFIG. 4.

In some instances, it may be desirable to store a clone snapshot on adifferent storage node 106 than the principal snapshots. Accordingly,the method 800 may include allocating 806 segments to the clone snapshoton the different storage node 106. This may be invoked by sending a newsnapshot instruction referencing the clone snapshot (i.e., an identifierof the clone snapshot) to the different storage node 106 and instructingone or more compute nodes 110 to route IOPs for the clone snapshot tothe different storage node 106.

The storage node 102 may store in each node of the hierarchy, dataidentifying one or more storage nodes 106 that store data for thesnapshot represented by that node of the hierarchy. For example, eachnode may store or have associated therewith one or more identifiers ofstorage nodes 106 that store a particular snapshot ID for a particularvolume ID. The node may further map one or more slice IDs (e.g., sliceoffsets) of a storage volume to one storage nodes 106 storing data forthat slice ID and the snapshots for that slice ID.

Referring to FIG. 10, one of the benefits of snapshots is the ability tocapture the state of a storage volume such that it can be restored at alater time. FIG. 10 illustrates a method 1000 for rolling back a storagevolume to a previous snapshot, particularly for a storage volume havingone or more clone snapshots.

The method 1000 includes receiving 1002, by the storage manager 102, aninstruction to rollback a storage volume to a particular snapshot SN.The method 1000 may then include processing 1004 each snapshot that is arepresented by a descendent node of the node representing snapshot SN inthe snapshot hierarchy, i.e. snapshots SN+1 to SMAX, where SMAX is thelast principal snapshot that is a descendent of snapshot SN (each“descendent snapshot”). For each descendent snapshot, processing 1004may include evaluating 1006 whether the each descendent is an ancestorof a node representing a clone snapshot. If not, then the storagemanager 102 may instruct all storage nodes 106 storing segments mappedto the descendent snapshot to free 1008 these segments, i.e. deleteentries from the segment map referencing the descendent snapshot andmarking corresponding PSIDs 316 as free in the segment map 314.

If the descendent snapshot is found 1006 to be an ancestor of a clonesnapshot, then step 1008 is not performed and the snapshot and anysegments allocated to it are retained.

FIG. 11 illustrates the snapshot hierarchy following execution of themethod 1000 with respect to the snapshot represented by node S3. As isapparent, snapshot S5 has been removed from the hierarchy and anysegments corresponding to these snapshots will have been freed on one ormore storage nodes 106.

However, since node S4 is an ancestor of clone node B1, it is notremoved and segments corresponding to it are not freed on one or morestorage nodes in response to the roll back instruction. Inasmuch as eachsnapshot contains only data written to the storage volume after it wascreated, previous snapshots may be required to recreate the storagevolume. Accordingly, the snapshots of nodes S3 to S1 are needed tocreate the snapshot of the storage volume corresponding to node B1.

Subsequent principal snapshots of the storage volume will be added asdescendants of the node to which the storage volume was rolled back. Inthe illustrated example, a new principal snapshot is represented by nodeS6 that is an immediate descendent of node S3. Node S4 is only presentdue to clone node B1 and therefore may itself be classified as a clonenode in the hierarchy in response to the rollback instruction of step1002.

Note that FIG. 11 is a simple representation of a hierarchy. There couldbe any number of clone snapshots, clones of clone snapshots anddescendent snapshots of any of these snapshots represented by nodes of ahierarchy. Accordingly, to roll back to a particular snapshot of aclone, the method 1000 is the same, except that descendants of the clonesnapshot are treated the same as principal snapshots and clones of anyof these descendants are treated the same as a clone snapshot.

Referring to FIG. 12, the illustrated method 1200 may be used to executea read request with respect to a storage volume that is represented by ahierarchy generated as described above with respect to FIGS. 8 through11. The illustrated method 1200 may also be executed with respect to astorage volume that includes only principal snapshots that aredistributed across multiple storage nodes, i.e., all the segmentscorresponding to snapshots of the same slice of the storage volume arenot located on the same storage node 106. In that case, the hierarchystored on the storage manager 102 stores the location of the segmentsfor each snapshot and therefore enables them to be located.

The method 1200 may be executed by a storage node 106 (“the currentstorage node”) with information retrieved from the storage manager 102as noted below. The method 1200 may include receiving 1202 a readrequest, which may include such information as a snapshot ID, volume ID(and/or slice ID), LBA, and size (e.g. number of 4 KB blocks to read).

Note that the read request may be issued by an application executing ona compute node 110. The compute node 110 may determine which storagenode 106 to transmit the read request using information from the storagemanager 102. For example, the compute node 110 may transmit a request toobtain an identifier for the storage node 102 storing data for aparticular slice and snapshot of a storage volume. The storage managermay then obtain an identifier and/or address for the storage node 106storing that snapshot and slice of the storage volume from thehierarchical representation of the storage volume and return it to therequesting compute node 110. For example, the storage manager 102 mayretrieve this information from the node in the hierarchy representingthe snapshot included in the read request.

In response to the read request, the current storage node performs thealgorithm illustrated by subsequent steps of the method 1200. Inparticular, the method 1200 may include identifying 1204 segmentsassigned to the snapshot ID of the read request in the segment (“thesubject snapshot”).

The method 1200 may include searching 1206 the metadata of the segmentsidentified in step 1204 for the LBA of the read request. If the LBA isfound, the data from the highest numbered segment having the LBA in itsmetadata is returned, i.e. the data that corresponds to the last-writtenmetadata entry including the LBA.

If the LBA is not found in any of the segments mapped to subjectsnapshot, then the method 1200 may include evaluating 1212 whether thesubject snapshot is the earliest snapshot on the current storage node.If not, then steps processing continues at step 1204 with the previoussnapshot set 1214 as the subject snapshot.

Steps 1204-1214 may be performed in the same manner as for steps 704-714of the method 700, including the various modifications and variationsdescribed above with respect to the method 700.

In contrast to the method 700, if the LBA is not found in any of thesegments corresponding to the subject snapshot for any of the snapshotsevaluated, then the method 1200 may include requesting 1216 a location,e.g. storage node identifier, where an earlier snapshot for the volumeID or slice ID is stored. In response to this request, the storagemanager 102 determines an identifier of a storage node 106 storing thesnapshot corresponding to the immediate ancestor of the earliestsnapshot stored on the current storage node in the hierarchy. Thestorage manager 102 may determine an identifier of the storage node 106relating to the immediate-ancestor snapshot and that stores data for aslice ID and volume ID of the read request as recorded for the ancestornearest ancestor node in the hierarchy of the node corresponding to theearliest snapshot stored on the current storage node.

If the current storage node is found 1218 to be the earliest snapshotfor the storage volume ID and/or slice ID of the read request, then thedata the storage manager 102 may report this fact to the storage node,which will then return 1220 a message indicating that the requested LBAis not available for reading, such as in the same manner as step 714 ofthe method 700.

If another storage node stores an earlier snapshot for the volume IDand/or slice ID of the read request, then the read request may betransmitted 1222 to this next storage node by either the current storagenode or the storage manager 102. The processing may then continue atstep 1202 with the next storage node as the current storage node. Theread request transmitted at step 1222 may have a snapshot ID set to thelatest snapshot ID for the storage volume ID and or slice ID of theoriginal read request.

The method 1200 may be performed repeatedly across multiple storagenodes 106 until the earliest snapshot is encountered or the LBA of theread request is located.

Referring to FIG. 13, storage according to the above-described methodsand systems may be incorporated into an application-orchestrationapproach. In the illustrates approach, an orchestration layer 1300implements a bundled application 1302 including a plurality of roles. Inthe following description, “bundled application” refers to a bundle ofapplications as implemented using the orchestration layer. A “role” isan instance of an executable that is managed by the orchestration layeras described herein as part of the bundled application. Accordingly, a“role” may itself be a standalone application, such as a database,webserver, blogging application, or any other application. Examples ofroles include CASSANDRA, HADOOP, SPARK, DRUID, SQL database, ORACLEdatabase, MONGODB database, WORDPRESS, and the like.

The orchestration layer 1300 may implement a bundled application 1302defining roles and relationships between roles as described in greaterdetail below. The bundled application 1302 may include a manifest 1304that defines the roles of the bundled application 1302, which mayinclude identifiers of roles and possibly a number of instances for eachrole identified. The manifest 1304 may define dynamic functions definehow the number of instances of particular role may grow or shrinkdepending on usage. The orchestration layer 1300 may then create orremove instances for a role as described below as indicated by usage andone or more functions for that role. The manifest 1304 may define atopology of the bundled application 1302, i.e. the relationship betweenroles, such as services of a role that are accessed by another role.

The bundled application 1302 may include provisioning 1306. Theprovisioning 1306 defines the resources of storage nodes 106 and computenodes 110 required to implement the bundle. The provisioning 1306 maydefine resources for the bundle as a whole or for individual roles.Resources may include a number of processors (e.g., processing cores),an amount of memory (e.g., RAM (random access memory), an amount ofstorage (e.g., GB (gigabytes) on a HDD (Hard Disk Drive) or SSD (SolidState Drive)). As described below, these resources may be provisioned ina virtualized manner such that the bundled application 1302 andindividual roles 1312 are not informed of the actual location orprocessing and storage resources and are relieved from anyresponsibility for managing such resources. In particular, storageresources may be virtualized by the storage manager 102 using themethods described above such that storage volumes are allocated and usedwithout requiring the bundled application 1302 or roles to manage theunderlying storage nodes 106 and storage device 108 on which the data ofthe storage volumes is written.

Provisioning 1306 may include static specification of resources and mayalso include dynamic provisioning functions that will invoke allocationof resources in response to usage of the bundled application. Forexample, as a database fills up, additional storage volumes may beallocated. As usage of a bundled application increases, additionalprocessing cores and memory may be allocated to reduce latency.

A bundled application 1302 may further include configuration parameters1308. Configuration parameters may include variables and settings foreach role of the bundle. The configuration parameters are defined by thedeveloper of the role and therefore may include any example of suchparameters for any application known in the art. The configurationparameters may be dynamic or static. For example, some parameters may bedependent on resources such as an amount of memory, processing cores, orstorage. Accordingly, these parameters may be defined as a function ofthese resources. The orchestration layer will then update suchparameters according to the function in response to changes inprovisioning of those resources that are inputs to the function. Forexample, CASSANDRA defines a variable Max_Heap_Size that is normally setto half the memory limit. Accordingly, as the memory provisioned for aCASSANDRA role increases, the value of Max_Heap_Size may be increased tohalf the increased memory.

The bundled application 1302 may further include action hooks 1310 forvarious actions that may be taken with respect to the bundledapplication and/or particular roles of the bundled applications. Actionsmay include some or all of stopping, starting, restarting, takingsnapshots, cloning, and rolling back to a prior snapshot. For eachaction, one or more action hooks may be defined. A hook is aprogrammable routine that is executed by the orchestration layer whenthe corresponding action is invoked. A hook may specify a script ofcommands or configuration parameters input to one or more roles in aparticular order. Hooks for an action may include a pre-action hook(executed prior to implementing an action), an action hook (executed toactually implement the action), and a post action hook (executedfollowing implementation of the action).

The bundled application 1302 may define a plurality of roles 1312. Eachrole may include one or more provisioning constraints. As noted above,the bundled application 1302 and roles 1312 are not aware of theunderlying storage nodes 106 and compute nodes 110 inasmuch as these arevirtualized by the storage manager 102 and orchestration layer 1300.Accordingly, any constraints on allocation of hardware resources may beincluded in the provisioning constraints 1314. As described in greaterdetail below, this may include constraints to create separate faultdomains in order to implement redundancy and constraints on latency.

The role 1312 may define a name space 1316. A name space 1316 mayinclude variables, functions, services, and the like implemented by arole. In particular, interfaces and services exposed by a role may beincluded in the name space. The name space may be referenced through theorchestration layer 1300 by an addressing scheme, e.g. <Bundle ID>.<RoleID>.<Name>. In some embodiments, references to the namespace 1316 ofanother role may be formatted and processed according to the JINJAtemplate engine or some other syntax. Accordingly, each role 1312 mayaccess the variables, functions, services, etc. in the name space 1316of another role 1312 on order to implement a complex applicationtopology. In some instances, credentials for authorizing access to arole 1312 may be shared by accessing the namespace 1316 of that role.

A role 1312 may further include various configuration parameters 1318defined by the role, i.e. as defined by the developer that created theexecutable for the role. As noted above, these parameters 1318 may beset by the orchestration layer 1300 according to the static or dynamicconfiguration parameters 1308. Configuration parameters may also bereferenced in the name space 1316 and be accessible (for reading and/orwriting) by other roles 1312.

Each role 1312 may include a container 1320 executing an instance 1322of the application for that role. The container 1320 may be avirtualization container, such as a virtual machine, that defines acontext within which the application instance 1322 executes,facilitating starting, stopping, restarting, and other management of theexecution of the application instance 1322. Containers 1320 may includeany container technology known in the art such as DOCKER, LXC, LCS, KVM,or the like. In a particular bundled application 1302, there may becontainers 1320 of multiple different types in order to take advantageof a particular container's capabilities to execute a particular role1312. For example, one role 1312 of a bundled application 1302 mayexecute a DOCKER container 1320 and another role 1312 of the samebundled application 1302 may execute an LCS container 1320.

Note that a bundled application 1302 as configured in the foregoingdescription may be instantiated and used or may be saved as a templatethat can be used and modified later.

FIG. 14 illustrates a method 1400 for executing a bundled application1302 using the orchestration layer 1300. The method 1400 may includeprovisioning 1402 storage and computation resources according to theprovisioning 1306. This may include allocating storage volumes accordingto the storage requirements, assigning the storage volumes to storagenodes 106, and selecting a compute node 110 or storage node 106providing the required computational resources (processor cores andmemory).

The method 1400 may include creating 1404 role instances for the roles1312 defined by the bundled application 1302. As described above, thismay include creating a container 1320 and instantiating the applicationinstance 1322 of the role 1312 within the container 1320. The order inwhich instances 1322 are created and started may be defined in themanifest 1304.

The method 1400 may include configuring 1406 each role according to theconfiguration parameters 1308, including executing any includedfunctions to determine values for dynamic parameters. As noted above,starting a bundled application 1302 may further include setting up 1408the roles 1312 to reference resources in the name space 1316 of anotherrole 1312. For example, a webserver may be configured to access adatabase by referencing configuration parameters and servicesimplemented by the database.

The method 1400 may further include executing 1410 any hooks 1310defined for the initial startup of the bundled applications.Accordingly, pre-startup, startup, and post startup hooks may beexecuted. Some or all of the functions of steps 1402-1410 may be definedas part of the pre-startup hook. Other functions may also be performedprior to steps 1402-1408 as defined by a pre-startup hook.

The actual commencement of execution of the instances 1322 of thebundled application 1302 may be performed in an order specified by thestartup hook and may include performing any attendant functions of theseinstances 1322 as specified by the startup hook. Following startup, oneor more other actions may be performed as specified by the developer inthe post-startup hook. These actions may invoke functions of theinstances 1322 themselves or executed by the orchestration layer 1300outside of the instances 1322, such as with respect to an operatingsystem executing the containers 1320 for the instances 1322.

The bundled application 1302 may then be accessed 1412 in order toperform the programmed functionality of the application instances 1322.As usage occurs, processing resources will be loaded and storage may befilled. The method 1400 may further include adjusting 1414 provisioningaccording to this usage and may performed adjustment to configurationparameters of the roles 1312 according to this provisioning as definedby the provisioning 1306 and configuration functions 1308.

As noted above, instances of roles may also be created or removedaccording to usage. Accordingly, where indicate by the manifest 1304,instances 1322 for a role 1312 may be created according to steps1402-1410 throughout execution of the bundled application 1302 asdefined by one or more dynamic functions in the manifest 1304 for thatrole 1312.

Referring to FIG. 15, the illustrated method 1500 may be used toimplement provisioning constraints 1314 for a role 1312 or constraintsfor an entire bundled application 1302. The method 1500 may be executedby the orchestration layer 1300, storage manager 102, or a combinationof the two.

The method 1500 may include receiving 1502 the provisioning constraint1314 for one or more roles 1312 of the bundled application 1302 anddetermining 1504 whether the constraint 1314 specify one or both of afault domain constraint and a latency constraint.

If a latency constraint is found 1506 to be included for a role 1312,then computational resources and storage resources to be provisioned forthe role 1312 may be constrained 1508 to be co-located. In particular,latency may be specified in terms of (a) a minimum network delay, (b) aminimum network throughput, (c) an explicit constraint to placecomputation and storage resources in the same subnetwork, or (d) anexplicit constraint to place computation and storage resources on thesame node, i.e. a hybrid compute and storage node 110, 106 that performsthe functions of both types of nodes with a single computer.

This constraint may be passed to the storage manager 102, which thenallocates computational and storage requirements according to it. Inparticular, one or more storage volumes for the role 1312 will beassigned to storage nodes 106 that can either (a) meet the latencyrequirement with respect to compute nodes 110 allocated to the role 1312(b) also provide the computational resources required for the role 1312.

If the constrain for a role 1312 is found 1510 to include a fault domainconstraint, then storage volumes for the role 1312 may be distributed1512 among the storage nodes 106 of the distributed storage system 100according to this requirement. For example, if storage volume B is aredundant (e.g., replica or backup copy) of storage volume A, the faultdomain constraint may indicate this fact. Accordingly, the storagemanager 102 may assign storage volume B to a different storage node 106than storage volume A. Various degrees of constraint may be specified.For example, a fault domain constraint may simply require a differentstorage device 108 but not require a different storage node 106. A faultdomain constraint may require that storage nodes 106 to which storagevolumes are assigned by in separate subnetworks, different geographiclocations, or have some other degree of separation. Similar fault domainconstraints may be specified for roles 1312, which may be constrained toexecute on different compute nodes 110 in order to provide redundantservices and reduce downtime.

The provisioning constraints 1502 based on fault domains and/or latencymay be combined with one or more other constraints. For example, aperformance constraint (IOPs/second) for a storage node may be imposed.Accordingly, only those compute nodes meeting the performancerequirement and the fault domain and/or latency requirements will beselected for provisioning.

As noted above, provisioning 1306 may define a processing requirement,such as a number of processing cores and an amount of storage for arole. Accordingly, compute nodes 110 may be selected at step 1508 suchthat both the latency requirement and processing requirement are met.

Referring to FIG. 16, the illustrated method 1600 may be executed by theorchestration layer 1302 with respect to a bundled application 1302 inorder to create a snapshot of the bundled application 1302 that can belater restored (see the method 1700 of FIG. 17).

The method 1600 may include flushing 1602 application buffers to disk.In many instances, performance of an application is accelerated bymaintaining data in a cache in memory, such that data in the cache isaccessed and updated without requiring writing to a disk in manyinstances, as known in the art. Accordingly, this buffer may be flushed1602 to disk by writing all valid data (i.e., not outdated due to asubsequent write) in the cache to the storage device 108 to which thatdata is addressed, e.g., to which the storage volume referenced by thedata is assigned.

In a like manner, a file system flush may be performed 1604. Performinga file system flush may include ensuring that all IOPs pending to beperformed by the file system have been executed, i.e. written to disk.As for step 1602, data written to a cache for the file system this isvalid may be written to a storage device 108 to which the data isaddressed, e.g., to which the storage volume referenced by the data isassigned.

The method 1600 may then include freezing 1606 the application instances1322 of each role 1312. In particular, inasmuch as each instance 1322 isexecuting within container 1320, the containers 1320 for the roles 1312may be instructed to pause execution of each instance 1322. This mayinclude stopping execution and saving a state of execution of eachinstance 1322 (state variables, register contents, program pointers,function stack, etc.).

The method 1600 may further include creating 1608 a snapshot of storagevolumes provisioned for the bundled application. This may includeexecuting the method 200 of FIG. 2 or any of the above-describedapproaches for implementing a snapshot of a storage volume.

The method 1600 may further include creating 1610 a topology snapshotfor the bundled application 1302. The topology of an application mayinclude some or all of the following information as constituted at thetime of executing step 1610 a listing of the roles 1312, which mayinclude one or more instances 1322 of the same role 1322, relationshipsbetween application instances 1322 of roles 1312 (name spacecross-references, configuration parameters), storage volumes assigned toroles 1312, or other information that describes the topology of thebundled application 1302. Applications may create metadata describingtheir state of operation. This data may also be saved as part of thetopology snapshot.

After the snapshot is created according to the method 1600, theapplication instances may be restarted and the bundled application 1302may continue to operate. If desired, the application may then be rolledback to the snapshot created according to the method 1600, as describedbelow with respect to FIG. 17.

FIG. 17 illustrates a method 1700 for rolling back a bundled application1302 to a snapshot, such as a snapshot created according to the method1600. The method 1700 may be executed by one or both of theorchestration layer 1300 and the storage manager 102.

The method 1700 includes receiving 1702 a rollback instruction, such asfrom an administrator desiring to return to a stable version of thebundled application 1302. The remaining steps of the method 1300 may beexecuted in response to the rollback instruction.

The method 1700 may include rolling 1704 back storage volumes assignedto the bundled application 1302 to the snapshots created for thesnapshot of the bundled application 1302 (e.g., at step 1608 of themethod 1600). This may include executing the method 1000 of FIG. 10 orperforming any other approach for rolling back a storage volume to aprior state.

The method 1700 may include restoring 1706 application instances fromthe application snapshot. As described above with respect to step 1606of the method 1600, an application instance 1322 may be frozen.Accordingly, data describing a state of execution of the applicationinstance 1322 may be reloaded into a container 1302 for that instance.If needed, the container for that application instance 1322 may becreated and the instance 1322 loaded into it prior to loading the stateof execution. This is particularly the case where the number ofapplication instances has changed since the application snapshot wascreate.

The method 1700 may further include restoring 1708 the applicationtopology saved for the bundled application at step 1610. Accordingly,relationships between application instances 1322 of roles 1312 (namespace cross-references, configuration parameters), storage volumesassigned to roles 1312, or other information that describes the topologyof the bundled application 1302 may be restored as it was at the timethe application snapshot was created

The method 1700 further include executing 1710, 1712, 1714 a pre-restarthook, restart hook, and post restart hook defined for the bundledapplication. As described above, each hook may be a routine defined by adeveloper to be executed for a particular action, restarting in thiscase. In step 1712, execution of the instances 1322 for the roles 1322may be restarted, along with any other actions specified by thedeveloper in the restart hook.

The bundled application 1302 as restored at steps 1704-1714 may then beaccessed 1716 as defined by the programming of the application instancesand the restored application topology.

Note that the snapshot of the bundled application 1302 may be restartedon different storage and compute nodes 106, 110 than those on which thebundled application 1302 was executing when the snapshot was created.Accordingly, the application snapshot may be restarted as a clone of thebundled application 1302 or moved to different hardware when executingthe method 1700.

In some instances, the hooks of steps 1710, 1712, 1714 may be differentwhen the application snapshot is being restarted as a clone as desiredby a developer. For example, a developer may desire to scale the cloneapplication to increase or decrease a number of databases, number ofpartitions of a database, or other aspect of the clone application.Accordingly, the hooks of steps 1710, 1712, 1714 may implement routinesto implement this increase or decrease.

For example, some applications are able to automatically detect thenumber of partitions of a database. In such instances, some or all ofthe hooks 1710, 1712, 1714 may reduce the number of partitions in adatabase of the clone applications and rely on the application todiscover this change. In other instances, some or all of the hooks 1710,1712, 1714 may be programmed to configure an application to access thedatabase with the reduced number of partitions where the application isunable to configure itself.

Referring to FIG. 18, as noted above, containers 1320 may be implementedas DOCKER containers. However, DOCKER containers are not particularlysuited for implementing stateful applications in which some or all ofthe state of an application is stored in persistent storage. This may bea disadvantage, particularly where a snapshot of an application is to becreate and used for rolling back or cloning (see discussion of FIG. 17).

In the illustrated approach, a DOCKER container 1320 is modified to usean external graph driver plugin for storing persistent data. In theillustrated embodiment, the graph driver plugin implements a layeredfile system 1800. In the illustrated implementation, the layered filesystem includes various layers 1802 a-1802 c that are combined with oneanother to define a file system as known in the art of graph driverplugins for use with DOCKER containers. In the illustrated embodiment,only one layer 1802 a is a read/write (R/W) layer and the remaininglayers are read only layers. The R/W layer 1802 a may be configured tomount a remote storage volume 1804 implemented by a storage node 106according to the methods described herein (see, e.g., FIGS. 1 through7). As described above, the storage volume 1804 may be a virtualizedstorage volume that is implemented without the container 1320 havingdata regarding a storage node 106 or device 108 on which the storagevolume is actually stored.

In this manner, any persistent data written or changed by an applicationinstance 1322 executed by the container 1320 will be performed on theremote storage volume 1804. Accordingly, when a snapshot of thecontainer 1320 is made or the container is moved to a differentlocation, the persistent data may be copied or recreated using theremote storage volume. No tracking of changes or other awareness of thepersistent state of the application instance 1322 is required in orderto achieve this functionality due to the use of the remote storagevolume 1804 to implement the R/W layer 1802 a.

FIG. 19 illustrates a method 1900 for using the architecture shown inFIG. 18. The method 1900 may be executed on a compute node 110 or hybridnode. The method 1900 may be executed as part of deployment of a bundledapplication 1300 in order to create and start a container 1320 on thecompute node 110.

The method 1900 may include creating 1902 a container 1320, e.g. aDOCKER container, on the compute node 110 and creating 1904 a layeredfile system, such as by associating a graph driver plugin with thecontainer 1320. A remote storage volume may also be created 1906, asdescribed above with respect to FIGS. 1 through 7. Creating 1906 astorage volume may be performed by requesting allocation of a storagevolume by the storage manager 102.

The method 1900 may include modifying 1908 metadata of the layered filesystem to refer to the remote storage volume as layer 0 (the R/W layer)of the layered file system.

An instance 1322 of an application executable may be loaded 1910 intothe container 1320 as well. The application instance 1322 may beexecuted 1912, which may result in writing 1914 of persistent date datafor the application instance 1322. These writes will be routed by thegraph driver plugin to the remote storage volume and persistently storedtherein.

If a move instruction is found 1916 to have been received, the method1900 may include instantiating 1918 a new container at a new location,e.g., a different compute node. The container may be loaded with aninstance 1322 of the executable application. The method 1900 may furtherinclude mounting 1920 the remote storage volume from step 1906 to thenew container as layer 0 of the layered file system. This may includemodifying the metadata for the new container as described above withrespect step 1908. The state of the application instance 1322 maytherefore be created using the data in the remote storage volume.

In some embodiments, the container to be moved may be frozen and copiedto the new location, rather than creating a new container. In that case,a clone of the remote storage volume storing the persistent state datamay be mounted to create a clone of the container.

The move instruction of step 1916 may be an instruction to move theapplication instance or be part of a process of cloning the applicationinstance. In either case, execution of the move may be proceeded withcreating a snapshot of the application as described above with respectto FIG. 16. Likewise, steps 1918 and 1920 may be executed as part of therollback process of FIG. 17.

Referring to FIG. 20, a bundled application 1302 may be tested todetermine robustness in response to failures. For example, a bundled1302 may include containers 1320 hosting multiple instances 1322 ofindividual roles 1312 and various replicas of storage volumes in orderto provide a degree of redundancy. Accordingly, the method 2000 may beexecuted by the orchestration layer 1300 to test the ability of thisredundancy to handle faults.

The method 2000 may include specifying 2002 a fault tolerance. This stepmay be performed manually as a user or developer of a bundledapplication 1302 specifies a degree of fault tolerance. The faulttolerance may be specified to the orchestration layer 1300 as a numberof failures for one or more entity classes, where the entity classesinclude some or all of storage nodes, compute nodes, containers,application instances, storage server racks, data centers, a networkconnection or network component (router, switch, network cable, etc.),or any other component of a bundled application 1302 or the distributedcomputing system on which the bundled application 1302 is executing. Forexample, the specification may read as follows:

-   -   3 compute nodes;    -   2 storage nodes;    -   5 containers;    -   1 rack; and    -   1 switch.

The method 2000 may further include collecting 2004 statuses ofcomponents of an application. The statuses may include statuses ofcontainers 1320, application instances 1322, storage volumes, storagenodes 106, compute nodes 110, and possibly other parts of thedistributed computing system, such as network components.

For example, some or all of these components may report their statusesperiodically to the orchestration layer 1300 or the orchestration layermay query these components and evaluate response received to determinewhether the response includes an error message. The orchestration layer1300 may interpret a failure to receive a response to a query from acomponent as a failure. The orchestration layer 1300 may store thesestatuses, i.e. a listing including a component and its correspondingstatus for some or all of the components evaluated.

The method 2000 may further include selecting 2006 a fault and selecting2008 a target for the fault. Selecting 2006 a fault may includeselecting an entity class to experience a fault. Selecting a target mayinclude selecting a specific instance of that entity class to experiencea fault. Accordingly, if a storage volume is selected, a specificstorage volume provisioned for the bundled application may be selectedas a target. The selections of steps 2006 and 2008 may be performedrandomly, e.g. according to some pseudo random function or using arandom number generator as known in the art.

The method 2000 may further include making 2010 a snapshot of the targetif possible. For example, if the target is a container, a snapshot ofthe container may be created (see, e.g. the approach for saving andrestoring the state of a container 1320, FIGS. 18 and 19). If the targetis a storage volume, then a snapshot of the storage volume may becreated (see, e.g. FIG. 2). Where the target is a compute node 110 orhybrid node, then snapshots of the containers 1320 hosted thereon may becreated. When the target is a storage node 106 or hybrid node, snapshotsof storage volumes implemented thereby may be created.

The method 2000 may include inducing 2012 a fault in the selectedtarget. For example, software implementing a container 1320 or storagevolume may include a setting that may be invoked by the orchestrationlayer to stop it or otherwise cause it to case to perform its function.Likewise, an other element, such as a network component selected astarget may be shut down or otherwise instructed to cease functioning.Where a node is selected as the target, then all entities implemented bythe node (storage volume and/or container 1320) may be instructed tostop or otherwise cease functioning. The node itself may also beinstructed to temporarily cease functioning, such as by ceasing toacknowledge or otherwise process network traffic. Where a rack isselected, then each node of the rack may be processed in a similarmanner—hosted storage volume and/or containers 1320 stopped and the nodeitself instructed to cease functioning. For each storage volume and/orcontainer 1320 that is stopped, snapshots may be created prior tostopping.

The method 2000 may include evaluating 2014 the state of the bundledapplication 1302. This may include evaluating a status as reported by acomponent of the application 1302, attempting to access a serviceimplemented by the application 1302, or any other approach known in theart for evaluating the function of an application. For example, where aninterface is exposed by the application 1302, the orchestration layer1300 may access a service implemented by that interface.

If the state of the bundled application 1302 indicates that it is nolonger functioning, then the method 2000 may end. A notification may bepresented to the user, such as a message indicating circumstances of thetest of steps 2006-2012. For example, the notification may includeinformation such as the entity class and target entity and informationregarding the state of the application 1302, such as error logsgenerated by the application 1302.

If the state from step 2014 indicates that the application continues tofunction, then the method 2000 may include incrementing 2016 a faultcount and rolling back 2018 the targets to the snapshots created at step2010. The fault count may be set to 1 during a first iteration, suchthat only one target is selected and processed according to steps2010-2014.

The method 2000 may then continue at step 2004 with the number of faultsbeing equal to the fault count. In particular, steps 2006-2008 may beperformed such that N targets are selected, where N is the fault count.For example, N entity class selections may be made randomly made suchthat the number of times a particular entity class is selected is lessthan or equal to the number of faults for that entity class specified atstep 2002. For the M (M=1 or more) times an entity class is selected, Mdifferent targets for that entity class may be randomly selected at step2008. The method 2000 may then continue repeating at step 2010 with thetargets as selected at step 2008.

The method 2000 may continue until one of (a) the application is foundto cease to function at step 2014 and (b) the number of faults selectedat step 2006 for each entity class is equal to the number specified foreach entity class in the fault tolerance. Where condition (b) is met,the application may be determined to meet the fault tolerance and anotification may be transmitted to a user or otherwise recorded thatindicates that the fault tolerance of step 2002 is met. In someembodiments, the method 2000 may continue to execute periodically inorder to verify that the fault tolerance continues to be satisfied.

Referring to FIG. 21, a node 106, such as a storage node or hybrid node,has a plurality of storage devices 108 a-108 b mounted thereto, thestorage devices 108 a-108 b being hard disk drives (HDD), solid statedrives (SSD), cloud storage, or some other type of storage device. Eachdevice 108 a-108 b stores one or more storage volumes 2100 a or one ormore slices of one or more storage volumes 2100 a, 2100 b, such asaccording to the approach described herein above. In particular, asdescribed above, slices may be assigned individually to devices 108 a,108 b such that an entire storage volume 2100 a, 2100 b need not resideon the same device 108 a, 108 b or even devices mounted to the same node106.

For each device 108 a, 108 b, the node 106 may collect usage statistics.For example, a software component implementing disk virtualization incoordination with the storage manager 102 may track IOPs and usage ofthe storage volumes 2100 a-2100 b and/or slices of storage volumes 2100a, 2100 b. In particular, storage usage 2102 may indicate the amount ofactual data stored in a storage volume 2100 a, 2100 b or slice of astorage volume 2100 a, 2100 b, such as in the form of a number ofallocated segments. IOP usage 2104 may indicate a number of IOPsaddressed to a storage volume 2100 a, 2100 b or slice of a storagevolume 2100 a, 2100 b. IOP usage may track one or both of write IOPs andread IOPs and may track a total number of IOPs per unit time.

FIG. 22 illustrates a method 2200 for assigning storage volumes todevices 108 a, 108 b of a node 106. The method 2200 may includeprovisioning 2202 a storage volume 2100 a for use by a bundledapplication 1302 according to the methods described above. The storagevolume 2100 a may then be assigned 2204 to a device 108 a of the node106. For example, the node 106 may be notified of the assignment and theassignment to the node 106 and device 108 a may be recorded in thevolume map 300 for the storage volume 2100 a.

The method 2200 may further include monitoring IOPs 2206 for the storagevolume 2100 a and evaluating 2208 whether IOP usage is excessive. Inparticular, this may include comparing the number of IOPs in a giventime window, e.g. 10 ms, 100 ms, 1 second, or the like, to an IOPthreshold. If this threshold is exceeded, then the IOPs may bedetermined 2208 to be excessive. The threshold may be static or dynamic.For example, it may be a function of an average number of IOPs perstorage volume assigned to the node 106. The evaluation of step 2208 mayevaluate the number of IOPs in the time window for those slices of thestorage volume 2100 a assigned to the device 108 a separately from theIOPs for slices assigned to other devices 108 b or nodes.

If the usage is found 2208 to be excessive, then another device may beadded 2210 to the storage volume 2100 a and one or more slices of thestorage volume may be redistributed 2212. For example, a load balancingapproach may be used. The number of IOPs in a time window for the slicesof the volume 2100 a may be measured (or past measurements are reused).A first set of slices may be assigned to the first device 108 a and asecond set of slices may be assigned to the second device such that thetotal number of IOPs in the time window for the slices of the first setis approximately equal to the total number of IOPs in the time windowfor the slices in the second set. “Approximately equal” may mean equalto within a value between the number of IOPs in the time window for theslice with the highest number of IOPs in the time window and the numberof IOPs in the time window for the slice with the lowest number of IOPsin the time window.

Steps 2206-2212 may be performed periodically such that IOPs aremonitored 2206 for a next time window after (and possibly overlapping)the window used at step 2206 of a previous iteration. Subsequentiterations may result in addition of devices or further redistributing2212 of slices based on excess usage. In some instances, redistribution2212 may be performed during an iteration of steps 2206-2212 withoutadding 2210 a device, such as when neither device 108 a, 108 b is foundto be being used within a threshold percentage of its IOPs capacitywithin the time window of step 2206.

Referring to FIG. 23, the illustrated method 2300 may be performed bythe node 106 and/or the orchestration layer 1300 in order to adjust thestorage available for a bundled application on the node 106.

The method 2300 may include monitoring 2302 storage usage of the storagevolumes hosted by the node 106. For example, storage usage may includecounting, by an agent implementing the storage scheme described herein,the number of segments allocated to each storage volume 2100 a, 2100 band/or slice of each storage volume 2100 a, 2100 b. For example, thisinformation may be obtained from the segment map 314.

The method 2300 may further include estimating 2304 a fill rate for thestorage volumes 2100 a, 2100 b on the node 106, which may include thefill rate for the set of slices of a particular storage volume 2100 a,2100 b on a particular device 108 a, 108 b. The method 2300 may beperformed for multiple storage volumes separately (“the subjectvolume”). In particular, a rate of write IOP generation, segmentallocation, or other metric of storage increase per unit time on thenode 106 for the subject volume within a predetermined time window maybe calculated. The fill rate for the subject volume may be evaluatedwith respect to some or all of (a) an amount of unused storage in thesubject volume, (b) an amount of unused storage in slices of the subjectvolume assigned to the node 106, (c) an amount of unused storage on anindividual device 108 a, 108 b, and (d) a total amount of unused storageon all devices 108 a, 108 b mounted to the storage node 106. Using thesevalues, step 2304 may further include estimating a time until full asone or more of the values of (a)-(d) divided individually by the fillrate.

The method 2300 may include evaluating 2306 whether more storage isneeded for the subject node. In particular, if a time until fullaccording to or more of values (a)-(d) is below a threshold time, it maybe determined 2306 that more storage is needed for the subject volume.

If no storage is found 2306 to be needed, then the method 2300 may endand be repeated at a later time, such as according to a predefinedrepetition period.

If more storage is found 2306 to be needed, the method 2300 may furtherinclude evaluating 2308 whether more memory, processors, or othercomputing resources are needed. In particular, high usage of storage maybe accompanied by additional requirements for processing, memory,network bandwidth, or other resources.

Accordingly, step 2300 may include evaluating current (e.g., measuredduring a time window defined for measuring) memory usage, processorusage, network bandwidth usage, NIC usage (network interfacecontroller), rack usage (e.g., number of rack blades in use and amountof use of each blade), or other usage statistic. For example, where thenode 106 is a hybrid node, then these statistics may be measured tocharacterize processing needs of one or more containers hosted by thenode 106 and to which the subject volume is mounted. A measured usagevalue may be compared to a corresponding threshold, which, if exceeded,results in a positive outcome to the evaluation of step 2308.

For example, where step 2308 indicates more processing or memory isneeded, the method 2300 may include creating 2310 a new container 1320,provisioning 2312 a new storage volume, and mounting 2314 the newstorage volume to the new container 1320. In particular, the newcontainer may be loaded with an instance 1322 of the same application asis accessing the subject volume. In this manner, IOPs may be distributedacross multiple containers 1320 and multiple storage volumes therebyresolving the need for more storage and more processors and/or memory.In a like manner, provisioning a new container and storage volume at adifferent location in a distributed computing system may also eliminatebottlenecks for network traffic determined to be present at step 2308.

Where steps 2310-2314 are executed, the orchestration layer 1300 maynotify the bundled application 1302 of the available new container andconfigure the bundled application 1302 to use the new container, such asby executing a hook 1310 that performs these functions as specified by adeveloper of the application 1302.

If more storage is found 2306 to be needed but more processing, memory,or other resources are not found 2308 to be needed, the method 2300 mayevaluate one or more alternatives to handle the need for additionalstorage.

For example, the method 2300 may include evaluating 2316 whetherexpanding of the subject volume, i.e., increasing its size, is possibleand desirable. For example, if a device 108 a-108 b has unused storagecapacity, the size of the subject volume may be increased 2318 to use upsome or all of this capacity, such that the amount of unused storagecapacity is above some threshold for excess capacity.

In some embodiments, step 2316 may include evaluating usage of theapplication's 1302 use of the subject volume. For example, where growthis slow and IOPs are nearly balanced between read and write IOPs,growing of the subject volume may be determined to be a suitablealternative.

If expanding is found 2316 not to be possible, the method 2300 mayinclude evaluating 2320 whether performing garbage collection (GC) onthe subject volume would resolve the lack of storage. For example, step2320 may include evaluating some or all of the following: (a) an elapsedtime since GC was performed on the subject volume, (b) an amount ofinvalid data in the subject volume, (c) and amount of valid data in thesubject volume. Determining the amount of valid and invalid data in aslice of a storage volume may be performed as describe above (seedescription of FIG. 6). Values according to (a) or (c) may be comparedto a corresponding threshold condition, which, if met, may invokeperforming 2322 GC. For example, if the elapsed time is greater than anelapsed time, then GC may be performed. If the amount of invalid data isabove an invalid data threshold, GC may be performed in someembodiments. If the amount of valid data is below a valid datathreshold, GC may be performed in some embodiments.

The method 2300 may further include evaluating 2324 whether adding adisk is needed. In some embodiments, if neither of steps 2316-2320 arefound to indicate other options for increasing storage, adding 2324 of adisk is found 2324 to be needed. In other cases, additionalconsiderations may be evaluated at step 2324, such as whether anadditional disk is mounted to the node 106 or is available for mountingto the node, such as based on an inventory or topology of a network asprovided to the node 106 or orchestration layer. If addition of a diskto the subject volume is determined 2324 to be possible and desirable,the method 2300 may include adding 2326 an additional disk to thesubject volume and redistributing 2328 slices of the subject volume,such as in the manner described for steps 2210 and 2212 of the method2200.

The method 2300 may be repeated periodically in order to accommodatechanges in usage.

Referring to FIG. 24, In some embodiments, the node 106 may additionallymaintain a volume limit 2400 a, 2400 b for each device 108 a, 108 b thatspecifies the number of storage volumes 23100 a-2100 c that may beallocated to that device 108 a, 108 b. The limit may be specified as anumber of volumes, a number of slices, a maximum quantity of storagerepresented by allocated storage volumes (GB, TB, etc.). The limits 2400a, 2400 b may be set initially by the orchestration layer 1300 and maysubsequently be adjusted by logic executing on the node 106 ororchestration layer 1300 as described with respect to FIG. 25.

FIG. 25 illustrates a method 2500 for adjusting the volume limit fordevices 108 a, 108 b of a node 106 and which may be executed by the node106 and/or orchestration layer 1300.

The method 2500 may include setting 2502 an initial volume limit. Thismay be a system-wide default implemented by the orchestration layer 1300or an application-wide limit specified by the bundled application 1302.The volume limit may be specified by a bundled application 1302 for eachrole 1312. The volume limit may be distributed by the orchestrationlayer 1300 to the nodes 106 to which storage devices 108 a, 108 b aremounted.

The method 2500 may further include monitoring 2504 throughput (IOPs) ofthe storage volumes 2100 a, 2100 b or slices of these volumes. Inparticular, the number of IOPs per unit time (e.g., per 10 ms, 100 ms, 1second, or other period) may be measured periodically. Read and writeIOPs may be counted separately or aggregated.

The method 2500 may further include evaluating 2506 whether there is athroughput imbalance on the device 108 a, 108 b of the node 106.Evaluating throughput may include evaluating read and write IOPs and mayalso include evaluating IOPs from performing garbage collection (GC),replication, or other sources of IOPs. For example, if the aggregatethroughput of the volumes or slices of volumes on a device 108 a, 108 bmay be determined to be imbalanced based on one or more of the followingcriteria:

-   -   1. The aggregate throughput is above a predetermined upper        threshold for the device 108 a, 108 b.    -   2. The aggregate throughput is below a predetermined lower        threshold for the device 108 a, 108 b.    -   3. The aggregate throughput of a first device 108 a, 108 b is        above the throughput of a second device 108 b, 108 a of the node        by some relative amount, e.g. T1 is greater than X*T2, where T1        is the throughput of the first device, T2 is the throughput of        the second device, and X is a value greater than 1.    -   4. The aggregate throughput of a first device 108 a, 108 b is        above the throughput of a second device 108 b, 108 a of the node        by some relative amount, e.g. T1 is greater than Y+T2, where T1        is the throughput of the first device, T2 is the throughput of        the second device, and Y is a predetermined number of IOPs per        unit time.

If an imbalance is found 2506, the method 2500 may include reducing 2508the volume limit for the device 108 a, 108 b having high throughputaccording to conditions 1, 3, or 4, above. For example, if the volumelimit is 10, only two volumes (or some number of slices of volumes) havebeen assigned to device 108 a, and its throughput is high enough to meetone of the conditions 1, 3, or 4, the volume limit for device 108 a maybe reduced, such as to a limit of two.

If an imbalance is found, the method 2500 may further include augmenting2510 the volume limit for a device 108 a, 108 b that has low throughputaccording to condition 2 or is the second device where a first devicemeets condition 3 or 4. For example, a device 108 b that has a number ofvolumes assigned thereto meeting the volume limit may have its volumelimit increased to permit the assignment of more storage volumes orslices inasmuch as its throughput is low.

Note that in some instances only step 2508 is executed where animbalance found 2506. In other instances, both of steps 2508 a and 2510are executed. In still others only step 2510 is performed. For example,if condition 1 is met, only step 2508 is performed in some embodiments.If condition 2 is met, only step 2510 is performed in some embodiments.

The method 2500 may further include evaluating 2512 whether a new devicehas been added to the node 106. In that case, the method 2500 mayinclude rebalancing volume limits according to usage. For example, thevolume limit of a first device having higher throughput relative to asecond device of the node may be reduced in response to addition of athird device such that additional volumes will be assigned to the thirddevice. Where the rebalancing of the load limits causes the volume limitof the first device to be less than the number of volumes assigned toit, one or more volumes assigned to the first device may be transferredto the third device. This transfer may be based on usage. For example,volumes may be transferred to the third device based on throughput withthe lowest throughput volumes being transferred until the volume limitis met on the first device.

In the event that a new storage volume is found 2514 to be added to thenode 106, the storage volume maybe assigned 2516 to a device based onthe current load limits as adjusted according to any of the foregoingsteps and throughput of the devices. For example, the new volume may beassigned to the device having the lowest throughput of those deviceshaving volumes assigned thereto under their volume limits.

Referring to FIG. 26, the illustrated method 2600 may be used to adjustthe topology of a bundled application 1302 following deployment.

The method 2600 may include deploying 2602, by the orchestration layer1300, a bundled application 1302, such as according to the methodsdescribed above, see, e.g., FIGS. 13 and 14. The method 2600 may furtherinclude monitoring 2604 usage of the components of the bundledapplication 1302 following deployment. Monitoring may include monitoringIOPs processing of storage volumes (see, e.g., step 2206 of FIG. 22,2504 of FIG. 25). Monitoring 2604 may further include evaluating usageof containers 1320. For example, statistics from containers 1320 orapplication instances 1322 executing within the containers may be storedin log files accessible by the orchestration layer 1300 or otherwisereported to the orchestration layer 1300 by the containers 1320 and/orapplication instances 1322. In other embodiments, a bundled application1302 may define a software component that characterizes loading of theapplication instances 1322 of the bundled application 1302. Accordingly,the orchestration layer 1300 may access this component, such as by meansof an exposed API, in order to monitor loading of the applicationinstance 1322 of the bundled application 1302.

The method 2600 may further include evaluating 2606 whether the usage asdetermined at step 2604 is such that scaling out of the containers 1320and corresponding application instances 1322 is needed. For example, theprovisioning 1306 for the bundled application may specify a usage for arole 1312 at which scaling out of the at role 1312 is required.Alternatively, provisioning 1306 may specify a maximum loading perinstance 1322 for a role 1312 after which another instance 1322 andcorresponding container 1320 are to be added.

If such a condition in the provisioning 1306 is found 2606 is found tobe met for a role 1312 (“the subject role”), the method 2600 may includeproviding one or more additional containers and corresponding storagevolumes, such as according to steps 2608-2618.

The method 2600 may include provisioning 2608 a compute node 110 orhybrid node that may be different from nodes currently executinginstances 1322 of the subject role. Provisioning 2608 may be performedsubject to provisioning constraints 1314 for the subject role. Inparticular, the node selected at step 2608 may be selected such that it:

-   -   Satisfies any fault domain (“anti-affinity”) constraints such        that the node selected is not the same node hosting another        container 1320 of the bundled application 1302 that is in a        different fault domain.    -   Satisfies any latency (“affinity”) constraints such that the        node selected is on the same node as a storage volume required        to be co-located with the container (the storage volume may be        moved to a new node to achieve this in some embodiments) or is        otherwise in a required proximity (same node, rack, data center,        etc.) to another resource (container, storage volume) of the        bundled application 1302 as specified by the bundled application        1302.

The method 2600 may further include provisioning 2610 a storage node106. Where the node selected at step 2608 is a hybrid node that alsofunctions as a storage node, step 2610 may be omitted. Step 2610 mayinclude selecting the storage node 106 according to any provisioningconstraints 1314 of the subject role. For example, the new storage nodemay be selected such that it:

-   -   Satisfies any fault domain (“anti-affinity”) constraints such        that the node selected is not the same node hosting another        storage volume of the bundled application 1302 that is in a        different fault domain.    -   Satisfies any latency (“affinity”) constraints such that the        node selected is on the same node as a container required to be        co-located with the storage volume (the container may be moved        to a new node to achieve this in some embodiments) or is        otherwise in a required proximity (same node, rack, data center,        etc.) to another resource (container, storage volume) of the        bundled application 1302 as specified by the bundled application        1302.

Where scale out is found 2606 to be needed, the method 1300 may furtherinclude executing 2612 one or more pre-scale-up hooks 1310 with respectto the instances 1322 of the subject role. For example, any pre-scale-uphook 1310 may be executed after the provisioning steps of 2608, 2610. Asnoted above, a hook 1310 is a script executed by or with respect to anapplication instance as part of an action. Accordingly, where a hook hasbeen defined for scaling out, this hook 1310 may be executed withrespect to one or more executing instance 1322 of the subject roleand/or instance 1322 of other roles that are determined by a developerto be impacted by the scaling out of the subject role.

The method 2600 may further include creating 2614 a container 1320 andloading it with an application instance 1322 for the subject role. Insome embodiments, an image is defined of a container 1320 loaded withthe application instance 1322. Accordingly, step 2614 may includeloading this image on to the node selected at step 2608.

The method 2600 may further include mounting 2616 a storage volume tothe container 1320 created at step 2614, such as a storage volumeprovisioned on the node selected at step 2610. The storage volume may beimplemented according to the methods described herein (see, e.g., FIGS.1-12).

The method 2600 may further include executing 2618 any post-scale-uphook 1310 defined by the bundled application 1302 for scaling out of thesubject role. The post-scale-up hook 1310 may include one or morescripts that are executed by the orchestration layer 1300 with respectto the new container 1320 and instance 1322 created at steps 2614 or anyother container 1320 and instance 1322 for the subject role or aninstance 1322 of a different role of the bundled application 1302. Forexample, the post-scale-up hook 1310 may configure one or more otherapplication instances 1322 to use a service provide by the new container1320 and instance 1322. For example, where a component distributes tasksto the instance 1322 of a role 1312, this component may be configured todistribute tasks to the new container 1320 and instance 1322 for thesubject role along with any previously-provisioned containers 1320 andinstances 1322.

The method 2600 may further include evaluating 2620 whether usage issuch that scaling in is necessary for the subject role. For example, theprovisioning 1306 for the bundled application may specify a usage for arole 1312 at which scaling in of that role 1312 is required.Alternatively, provisioning 1306 may specify a minimum loading perinstance 1322 for a role 1312 after which an instance 1322 andcorresponding container 1320 are to be removed. In a typicalapplication, the minimum loading is less than the maximum loading atwhich the subject role will be scaled up (see step 2606). In thismanner, there is a range of loading values between the maximum andminimum loadings within which no scaling out or scaling in is performed.

If the condition of step 2620 is met for scaling in the subject role,the method 2600 may include executing 2622 any pre-scale-down hook 1310specified by a developer for the subject role. For example, thepre-scale down hook 1310 may transfer tasks from a container 1320 to beshut down (“the selected container”), e.g. a least loaded container orrandomly selected container, to another container 1320 for the subjectrole.

The method 2600 may further include shutting down 2624 the selectedcontainer. At step 2626, the method 2600 may include one or (a)transferring data stored in a storage volume mounted to the selectedcontainer to another container 1320 hosting an instance 1322 of thesubject role and (b) mounting the storage volume to the other container1320. The method 2600 may further include executing 2628 apost-scale-down hook 1310 specified by the developer for the subjectrole. For example, the post-scale-down hook may configure othercomponents of the bundled application to no longer refer to theeliminated container 1320.

The method 2600 may be repeated periodically with scaling out or scalingin performed as needed.

Referring to FIG. 27, the illustrated method 2700 may be used toincrease or decrease the amount of computing resources (processor cores,memory) used by a container 1320 and its hosted application instance1322 on a node (compute node 110 or hybrid node).

The method 2700 may include deploying 2702 a bundled application 1302and monitoring 2704 usage of the bundled application 1302, such as inthe manner described for steps 2602 and 2604 of the method 2600.

The method 2700 may include processing some or all of the containers1320 of a bundled application according to the remaining steps of themethod 2700. For example, the method 2700 may include evaluating 2706for each container 1320 of the bundled application 1302 (“the subjectcontainer”) whether scaling out of computing resources is required. Forexample, for the role 1312 for which the each container executes anapplication instance 1322 (“the subject role”), the provisioning 1306may define a relationship between loading (number of IOPs or othermetric of loading) of a container 1320 of the subject role and computingresources provisioned to the container 1320. For example, for a range ofloading values, the provisioning 1306 may define a number of processorcores and amount of memory required for loading within that range.Accordingly, if the amount of resources currently provisioned for thesubject container is less than what is specified in the provisioning1306 for the current loading of the subject container, additionalcomputing resources may be provisioned as described below. Note that thethreshold loading for adding additional computing resources may bedifferent from (e.g., lower than) a threshold loading at which anadditional container will be provisioned according to the method 2600.

The step of monitoring 2704 and evaluating 2706 loading may be performedon the computing device hosting the orchestration layer 1300 or may beperformed locally on the node executing the subject container (“thesubject node”). Where steps 2704 and 2706 are performed by theorchestration layer 1300, the orchestration layer 1300 may transmit 2708a scale out instruction to the subject node. Where steps 2704 and 2706are performed locally, step 2708 may be omitted and scaling out may beperformed in response to detecting a need for additional resources atstep 2706.

The method 2700 may include evaluating 2710 whether a sufficient amountof computing resources is available on the subject node. For example,where M processor cores are available on the subject node and N coresare currently allocated, step 2710 may include evaluating whether M−N isgreater than or equal to the number of cores required to be allocated tothe subject container to meet the requirements evaluated at step 2706.

In a similar manner, where step 2706 indicates that more memory isneeded, step 2710 may include evaluating whether an amount of memory ofthe subject node that is available to be allocated to containers 1320and that is not already allocated to a container 1320 is greater than orequal to the amount of additional memory required by the subjectcontainer as determined at step 2708.

If the condition of step 2710 is met, then additional cores and/ormemory required to meet the requirements indicated at step 2706 areallocated 2712 on the subject node. For example, an agent executing onthe subject node may communicate to the subject container thatadditional memory and/or cores are available as allocated at step 2712.In some instances, step 2712 may additionally require restarting of thesubject container, such as in the case where the subject container isexecuting a Java Virtual Machine (JVM).

Note that in some embodiments, the amount of memory and cores on thesubject node that are available for allocation may be stored by theorchestration layer 1300. Likewise, the orchestration layer 1300 maystore the allocation of the memory and cores to containers 1320 ofbundled applications 1302 during deployment of the bundled applications.Accordingly, step 2710 may be performed by the orchestration layer 1300rather than being performed on the subject node. Accordingly, step 2710may be performed prior to step 2708 in such instances. The orchestrationlayer 1300 may also invoke performing 2712 the allocation on the subjectnode and record this allocation for use in determining futureallocations on the subject node.

If step 2710 indicates that there are insufficient resources, the method2700 may include provisioning 2714, such as by the orchestration layer1300, another compute node that has an amount of available memory andnumber of available cores meeting the requirements of the subjectcontainer as determined at step 2706. The node selected at step 2714 maybe selected subject to provisioning constraints (see step 2608 of FIG.26).

The subject container may then be transferred 2716 to the new nodeselected at step 2714. For example, the state of the subject containermay be transferred to a new container on the new node according to theapproach described with respect to FIGS. 18 and 19 and/or the approachdescribed with respect to FIGS. 16 and 17 for creating and restoring asnapshot of an application, including the containers thereof.

The method 2700 may further include mounting 2718 a storage volumeformerly mounted to the subject container to the new container createdat step 2716.

As for other embodiments disclosed herein, transferring of a containerto a new node may be accompanied by executing pre-transfer andpost-transfer hooks 1310 as specified by a developer for the subjectrole.

The method 2700 may include evaluating 2720 whether scaling in ofcomputing resources is needed. For example, if the usage from step 2704corresponds to a lower amount of computing resources than are currentlyallocated to the subject container as specified by the provisioning 1306of the bundled application 1302.

In that case, the resources of the subject container may be scaled 2722down. This may include the agent executing on the subject node reducingthe resources available to the subject container. Step 2722 may includetransmitting an instruction to scale down from the orchestration layer1300 to the agent on the subject node and/or to the subject container,which will then process the instruction by reducing the allocation ofcomputing resources by the subject container.

Referring to FIG. 28, a resource table 2800 may be maintained by abundled application 1302 or individual container 1320 of a bundledapplication to indicate the amount of resources (memory 2804, processorcores 2806) available to a particular container, which may berepresented by an identifier 2802 for the container. The resource table2800 may be populated and used by application logic in order to controlits operation and this logic may be independent of the orchestrationlayer 1300 or agents executing on compute nodes 110 or hybrid nodes.Accordingly, a node 2808 (such as a compute node 110 or hybrid node) mayinclude some or all of the illustrated components in order to facilitatepopulating of the resource table 2800 by a bundled application accordingto provisioning provided by the orchestration layer 1300.

The node 2808 may host one or more containers 2810. Each container mayhave a virtual file system 2812 mounted thereto. The virtual file systemmay be stored on a storage volume, such as a storage volume implementedaccording to the methods described herein. The virtual file system 2812may be implemented using any virtual file system, such as the LINUXContainer File System (LXCFS). The virtual file system may includevirtual resource files 2814 that list resources available to thecontainer. For example, a file/proc may list the number or processorcores available to the container. Accordingly, the/proc file may listthe number of cores allocated to the container 2810 to which the virtualfile system 2812 is mounted, which may be less than the number ofprocessors of the node 2808. Other files 2814 may list other systemresources, such as an amount of available memory. Again, these files maylist the amount of that resource, e.g., memory, allocated to thecontainer 2810 to which the file system 2812 rather than the amount ofthat resource available on the node 2808.

The node 2808 may host an operating system including a kernel 2816 thatimplements various system functions, such as basic input outputfunctions, networking, and other functions implemented by a kernel asknown in the art. Accordingly, the kernel 2816 is programmed to processsystem calls from containers 2810 accessing these system functions. Inthe illustrated embodiment, the kernel 2816 is modified to include asystem call interceptor 2818 that intercepts system calls attempting toaccess system resource files 2820 stored in the file system 2822 of thenode 2808. These calls may be intercepted and instead be processed usingvirtual resource files that list resources (processor cores, memory)allocated to the container 2810 making the intercepted system call,where these resources are as allocated by the orchestration layer 1300.Accordingly, a container 2810 attempting to read the resource files 2820will receive data from the virtual resource files 2824 and thereforewill be limited to using the resources allocated to it by theorchestration layer 1300 rather than all of those available on the node2808.

FIG. 29 illustrates a method 2900 for virtualizing system resources,such as using a node 2808 configured as shown in FIG. 28. The method2900 may be executed by the computing device hosting the orchestrationlayer 1300 invoking performance of the recited actions on the node 2808,such as by an agent executing on the node 2808. The method 2900 mayinclude creating 2902 a container 2810 on the node 2808, such asaccording to any of the methods described herein. A virtual file system2812 may be mounted 2904 to the container, such as an LXCFS residing ona storage volume mounted to the container 2810. The method 2900 mayinclude storing 2906 virtual system resource files in the virtual filesystem where the virtual system resource files list resources allocatedto the container 2810 by the orchestration layer. The method 2900 mayfurther include storing 2908 virtual system resource files in the filesystem of the node 2808, e.g. the file system implemented by theoperating system of the node 2808 independent of the virtual file system2812 and container 2810. As noted above, the contents of the virtualsystem resource files at step 2906 and 2908 may include allocations ofsystem resources (memory, processor cores) made by the orchestrationlayer 1300 according to provisioning 1306 for the bundled application1302.

If a call is detected 2910 by the container 2810 to read the virtualsystem resource files in the virtual file system, then this call issimply processed such that the contents of a file referenced in the callis returned 2912 to a source of the call, such as the applicationinstance 1322 executing in the container 2810. The data that is read maythen be added 2920 by the application instance 1322 to a resource table2800. The application instance 1322 may thereafter use this informationto govern its execution thereby implementing allocations assigned by theorchestration layer 1300 according to provisioning 1306 of a bundledapplication of which the container 2810 is a part.

If a call is detected 2914 to a file system of the node 2808 to read thesystem resource files of the node 2808, such as by call interceptor2818, the method 2900 may include intercepting 2916 the system call. Thecall interceptor 2818 may substitute the system call with a call to readone or more of the virtual system resource files that were stored atstep 2908, which results in the kernel 2816 reading one or more of thesevirtual system resource files and returning 2918 the contents of thesefiles to the issuer of the call, such as the application instance 1322executing in the container 2810. The application instance 1322 may thenuse this data to populate 2920 the resource table 2800.

Note that the method 2700 describes an approach for scaling out orscaling in the allocation of system resources (memory, processor cores)of a container 1320. Accordingly, this may be implemented using theapproach of FIGS. 28 and 29 by adjusting the values in the virtualsystem resource files in the host file system 2822 and virtual filesystem 2812 in order to set an amount of a resource available to thecontainer 2810 as determined according to the method 2700.

FIG. 30 illustrates a method 3000 for suggesting improvements toprovisioning 1306 of a bundled application 1302 or to other requests forprovisioning of storage after a bundled application 1302 has beendeployed. The method 3000 may be executed by the orchestration layer1300.

The method 3000 may include receiving 3002 a provisioning request. Theprovisioning request maybe received as the provisioning 1306 of abundled application 1302 as part of deploying the bundled application1302 by the orchestration layer 1300. The provisioning request may bereceived from a user after a bundled application 1302 has been received.The provisioning request may be an automated provisioning request basedon usage of the bundled application 1302 (see, e.g., FIGS. 21-27 andcorresponding description).

The method 3000 may further include evaluating 3004 a topology of adistributed computing system 100 on which the bundled application 1302is deployed or is to be deployed. In particular, the available storageon various storage devices 108 of the distributed computing system 108may be evaluated with respect to the provisioning request. For example,for a provisioning request for a storage volume, storage nodes 106 maybe identified that have available storage capacity and IOPs capacitythat are within some threshold of the storage size and performancerequirements, respectively, of the provisioning request. This mayinclude identifying 3006 storage devices 108 that have capacity that isless than or greater than the storage size indicated in the provisioningrequest but are within a storage capacity threshold from the storagesize. Likewise, storage devices may be identified that have availableIOPs capacity that is less than or greater than the performancerequirement of the provisioning request but within a performancethreshold from the performance requirement.

The method 3000 may include evaluating 3008 whether an alternativeallocation to that included in the provisioning request is possible. Thefollowing examples illustrate how this evaluation 3008 may be performed:

-   -   1. The provisioning request includes a storage size A. A device        of size B is available, B<A, but is not in use by any other        storage volume. The difference (A−B) is within a predefined        storage threshold for an undersized device. The device has IOPs        capacity meeting the performance requirement of the provisioning        request. An alternative allocation may therefore have storage        size B rather than storage size A.    -   2. The provisioning request includes a storage size A. A device        of size C is available, C>A. The difference (C−A) is within a        predefined storage threshold for an oversized device. The device        has IOPs capacity meeting the performance requirement of the        provisioning request. An alternative allocation may therefore        have storage size C rather than storage size A.    -   3. A device having a size A, B, or C as defined in items 1 and 2        but has IOPs capacity D below the performance requirement E of        the provisioning request, but the difference (E−D) is within a        predetermined performance threshold for below-requirement        performance. The alternative allocation may therefore have a        storage size of the device (A, B, or C) and a performance        requirement D.

A storage device 108 meeting the conditions of any of items 1 through 3above may be found 3008 to be a potential alternative allocation. If analternative allocation is found 3008, the method 3008 may includepresenting 3010 the alternative allocation to a user, such as in theform of a text, email, or message displayed in a graphical userinterface of a display device.

If an input is found 3012 to be received from the user indicating anacceptance of one of the alternative allocations, the alternativeacceptance is implemented 3014, rather than the original provisioningrequest. Implementing 3014 the alternative acceptance may includeprovisioning a storage volume having the storage size and IOPscorresponding to the storage size and performance of the acceptedalternative allocation. Implementing 3014 the alternative allocation maybe performed according to any of the methods disclosed herein forprovisioning a storage volume.

If no alternative allocation is found 3008 or no alternative allocationis accepted 3012 by the user, a storage volume having the size andperformance of the original provisioning request may be implemented, ifpossible.

The method 3000 provides the advantage of giving the user theopportunity to adjust provisioning requirements to achieve improvedperformance for a bundled application. For example, by selecting asmaller available device to implement a single storage volume, the usermay obtain use of a dedicated device for the storage volume, improvingthroughput and simplifying the implementation of anti-affinityconstraints inasmuch as sharing of a device 108 by multiple storagevolumes is not possible. In a like manner, increasing the size of astorage volume to wholly use a storage device 108 improves performanceand prevents the assignment of multiple storage volumes to that device108.

FIG. 31 illustrates an example method 3100 for provisioning one or morestorage volumes (“the subject storage volumes”). The illustrated method3100 may be performed by the orchestration layer 1300. The illustratedmethod 3100 may be performed during deployment and provisioning of abundled application 1302 (see FIGS. 13-17 and correspondingdescription). The illustrated method 3100 may be performed when astorage volume is provisioned or moved based on usage (see, e.g., FIGS.21-30 and corresponding description). For example, the bundledapplication 1302 may invoke the creation of a plurality of subjectstorage volumes for all the roles 1312 of the bundled application 1302,all containers 1320 or a role, or for any other set of components of thebundled application 1302.

The method 2900 may include planning 3102 for the subject storagevolumes. As described below with respect to FIG. 32, this may includeselecting a storage device 108 for each subject storage volume such thatthe devices for the subject storage volumes satisfy affinity andanti-affinity rules for the subject storage volumes by the bundledapplication 1302. In some embodiments, planning for the placement of newstorage volumes and previously-provisioned storage volumes may beperformed at step 3102. Accordingly, where the planning of step 3102results in a different location for a storage volume, that storagevolume may be moved to a new storage device 108 defined according to theplanning 3102.

For any of the subject storage volumes for which storage is not found3104 to be available during the planning step 3102, the method 3100 mayinclude notifying 3106 of failure. The notification may be addressed toa user, in the form of an entry in a log file, output on a graphicaluser interface, or other means.

For each subject storage volume for which storage was found 3104 to beavailable during the planning step 3102, the method 3100 may includemaking 3108 a file system on the device selected for the each subjectstorage volume. This file system may then be mounted 3110 to a container1320 of the bundled application. In particular, the orchestration layer1300 may instruct the storage node 106 and a compute node 110 tocommunicate with one another to mount the subject storage volume to acontainer 1320 on the compute node 110 as specified by the bundledapplication 1302. Where the subject storage volume is implemented by ahybrid node, the storage volume may be mounted 3110 to a container 1320executing on the hybrid node.

The method 3100 may further include executing 3112 one more hooks 1310defined by the bundled application 1302 for addition of a volume. Forexample, a post-creation hook may invoke restarting of the container1320 to which the subject storage volume is mounted. Alternatively, thehook may restart the application instance 1322 executing within thecontainer. The hook 1310 may configure one or more other applicationinstances to which the subject storage volume is not mounted to use thesubject storage volume. The one or more hooks 1310 may be executed bythe orchestration layer 1300. The one or more hooks 1310 may be invokedby the orchestration layer 1300 to execute on the node hosting thedevice 108 on which the subject storage volume is created, the nodehosting the container 1320 to which the subject storage volume ismounted, or any other node on which a component of the bundledapplication 1302 executes.

The method 1300 may further include notifying 3114 the bundledapplication that the subject storage volumes have been provisioned. Insome embodiments, this notification may be implemented by apost-creation hook 1310.

FIG. 32 illustrates a method 3200 for planning 3102 for the subjectstorage volumes. The method 3200 may be executed by the orchestrationlayer 1300. The method 3200 includes receiving 3202 a storageprovisioning request including requests for the subject storage volumesand the provisioning constraints 1314 for the subject storage volumes.Processing of the provisioning request may also include evaluating ofany prior assignments of storage volumes to storage devices 108 of thedistributed computing system 100. Accordingly, records made of suchassignments may be provided with the storage provisioning request oraccessed by the orchestration layer 1300 as part of the method 3200.

The method 3200 may include assigning storage volumes to storage devices108 in order. Accordingly, one of the requests for the subject storagevolumes that has not currently assigned to a storage device 108 may beselected 3202 as the current request for processing according to theremaining steps of the method 3200. This selection may be random, basedon order (first in first out), or based on size—the request for astorage volume with the largest size may be processed first. Any otherordering for processing the storage requests may be used.

The method 3200 may include evaluating 3206 whether a storage device isavailable and satisfies any affinity and/or anti-affinity constraintsfor the current request. This may include evaluating whether there is astorage device 108 with remaining capacity greater than or equal to asize specified in the current request that is in a different faultdomain than another storage volume or container 1320 for which ananti-affinity constraint is defined. Step 3206 may further includeevaluating whether there is a storage device 108 having remainingcapacity greater than or equal to the size specified in the currentrequest that is in required proximity to another storage volume orcontainer 1320 for which an affinity constraint is defined. In someembodiments, any devices 108 identified at step 3206 are constrained tomeet a performance requirement (e.g., available IOPs capacity) specifiedin the current request. The evaluation of step 3206 may be performedwhile taking into account assignments made according to the method 3200,i.e. any assignments of storage provisioning requests to devicesaccording to the method 3200 may be taken into account when evaluatingaffinity and anti-affinity rules for the current request such that anyassignment of the current request to a device 108 does not violate theserules with respect to any of the previously-assigned storageprovisioning request.

If the condition of step 3206 is met, the method 3200 may includeassigning 3208 the current request to one of the devices identified atstep 3206, such as to the device of those identified at step 3206 thathas the smallest remaining capacity. A storage volume corresponding tothe current request may then be created on the device selected at step3208, such as according to the method 3100.

If the condition of step 3206 is not met, the method 3200 may includeevaluating 3212 whether another storage provisioning request has beenassigned to a device 108 according to a previous iteration of steps 3206and 3208. If so, one or more previous assignments of storage volumerequests may be undone 3214. For example, the most recent assignmentmade at step 3208 may be undone 3214. The method may then repeat fromstep 3206. Steps 3212-3214 may be performed repeatedly until thecondition of step 3206 is met or there are no prior assignmentsremaining to be undone 3214. In particular, assignments may be undone3214 until storage is found 3206 to be available or no assignmentsremain to be undone. Storage provisioning requests for which assignmentsare undone 3214 may be returned to the pool of storage provisioningrequests to be assigned according to the method 3200, such as to the endof an ordering of the storage provisioning requests.

If no prior assignments remain to be undone, failure to assign thecurrent request may be reported 3216, such as to a user, theorchestration layer 1300, or some other entity. In some instances, wherea storage volume request is cannot be assigned, the method 3200 may end.

In other instances, processing continues at step 3210 with an evaluationof whether any storage volume requests from step 3202 remain to beassigned. If so, processing continues at step 3204 with selection ofanother unassigned storage volume request for processing starting atstep 3206. In a like manner, if the current request is successfullyassigned 3208 to a device and a storage volume request if found 3210 toremain to be assigned, then processing continues at step 3204.

FIG. 33 illustrates a method 330 for selecting hosts for components(storage volumes, containers) of a bundled application 1302. Theillustrated method 3300 may be executed by the orchestration layer 1300while deploying a bundled application 1302 or adding a component to abundled application 1302.

The method 3300 may include selecting 3302 a subnet of the distributedstorage system. In particular, the orchestration layer 1300 or a usermay select an unused subnet or a subnet having nodes 106, 110 or hybridnodes sufficient to host the components of the bundled application 1302.In some embodiments, step 3302 may include selecting multiple subnets.For example, where an anti-affinity constraint requires that componentsbe in separate subnets, multiple subnets satisfying the anti-affinityconstraint with respect to one another may be selected. In particular,an anti-affinity constraint may require that components be in differentsubnets, different racks, different data centers, different cities, etc.Accordingly, the subnets selected at step 3320 may be selected to meetthis constraint.

The method 3300 may include identifying 3304 a set of host addresses foreach subnet selected at step 3302. This may include evaluating apersistent record of the hosts in the distributed storage system thatmaps each host to an IP (internet protocol) address. Those hosts with anIP address corresponding to the one or more selected subnets may beidentified 3304 from this record. Any other approach for discoveringhosts in a network may be used to identify hosts having IP addressescorresponding to the selected subnet.

The method 3300 may then include assigning 3306 the IP addresses of thehosts identified at step 3304 to the components of the bundledapplication. In particular, hosts with storage devices 108 mountedthereto may be assigned to storage volumes of the bundled application1302. Other hosts may be assigned to execute containers 1320 of thebundled application 1302. The assignments from step 3306 may be madeaccording to one or more affinity and/or anti-affinity constraints. Forexample, assignments may be made according to the approach describedabove with respect to FIG. 32.

FIG. 34 is a block diagram illustrating an example computing device3400. Computing device 3400 may be used to perform various procedures,such as those discussed herein. The storage manager 102, storage nodes106, compute nodes 110, and hybrid nodes, may have some or all of theattributes of the computing device 3400.

Computing device 3400 includes one or more processor(s) 3402, one ormore memory device(s) 3404, one or more interface(s) 3406, one or moremass storage device(s) 3408, one or more Input/output (I/O) device(s)3410, and a display device 3430 all of which are coupled to a bus 3412.Processor(s) 3402 include one or more processors or controllers thatexecute instructions stored in memory device(s) 3404 and/or mass storagedevice(s) 3408. Processor(s) 3402 may also include various types ofcomputer-readable media, such as cache memory.

Memory device(s) 3404 include various computer-readable media, such asvolatile memory (e.g., random access memory (RAM) 3414) and/ornonvolatile memory (e.g., read-only memory (ROM) 3416). Memory device(s)3404 may also include rewritable ROM, such as Flash memory.

Mass storage device(s) 3408 include various computer readable media,such as magnetic tapes, magnetic disks, optical disks, solid-statememory (e.g., Flash memory), and so forth. As shown in FIG. 34, aparticular mass storage device is a hard disk drive 3424. Various drivesmay also be included in mass storage device(s) 3408 to enable readingfrom and/or writing to the various computer readable media. Mass storagedevice(s) 3408 include removable media 3426 and/or non-removable media.

I/O device(s) 3410 include various devices that allow data and/or otherinformation to be input to or retrieved from computing device 3400.Example I/O device(s) 3410 include cursor control devices, keyboards,keypads, microphones, monitors or other display devices, speakers,printers, network interface cards, modems, lenses, CCDs or other imagecapture devices, and the like.

Display device 3430 includes any type of device capable of displayinginformation to one or more users of computing device 3400. Examples ofdisplay device 3430 include a monitor, display terminal, videoprojection device, and the like.

Interface(s) 3406 include various interfaces that allow computing device3400 to interact with other systems, devices, or computing environments.Example interface(s) 3406 include any number of different networkinterfaces 3420, such as interfaces to local area networks (LANs), widearea networks (WANs), wireless networks, and the Internet. Otherinterface(s) include user interface 3418 and peripheral device interface3422. The interface(s) 3406 may also include one or more peripheralinterfaces such as interfaces for printers, pointing devices (mice,track pad, etc.), keyboards, and the like.

Bus 3412 allows processor(s) 3402, memory device(s) 3404, interface(s)3406, mass storage device(s) 3408, I/O device(s) 3410, and displaydevice 3430 to communicate with one another, as well as other devices orcomponents coupled to bus 3412. Bus 3412 represents one or more ofseveral types of bus structures, such as a system bus, PCI bus, IEEE1394 bus, USB bus, and so forth.

For purposes of illustration, programs and other executable programcomponents are shown herein as discrete blocks, although it isunderstood that such programs and components may reside at various timesin different storage components of computing device 3400, and areexecuted by processor(s) 3402. Alternatively, the systems and proceduresdescribed herein can be implemented in hardware, or a combination ofhardware, software, and/or firmware. For example, one or moreapplication specific integrated circuits (ASICs) can be programmed tocarry out one or more of the systems and procedures described herein.

In the above disclosure, reference has been made to the accompanyingdrawings, which form a part hereof, and in which is shown by way ofillustration specific implementations in which the disclosure may bepracticed. It is understood that other implementations may be utilizedand structural changes may be made without departing from the scope ofthe present disclosure. References in the specification to “oneembodiment,” “an embodiment,” “an example embodiment,” etc., indicatethat the embodiment described may include a particular feature,structure, or characteristic, but every embodiment may not necessarilyinclude the particular feature, structure, or characteristic. Moreover,such phrases are not necessarily referring to the same embodiment.Further, when a particular feature, structure, or characteristic isdescribed in connection with an embodiment, it is submitted that it iswithin the knowledge of one skilled in the art to affect such feature,structure, or characteristic in connection with other embodimentswhether or not explicitly described.

Implementations of the systems, devices, and methods disclosed hereinmay comprise or utilize a special purpose or general-purpose computerincluding computer hardware, such as, for example, one or moreprocessors and system memory, as discussed herein. Implementationswithin the scope of the present disclosure may also include physical andother computer-readable media for carrying or storingcomputer-executable instructions and/or data structures. Suchcomputer-readable media can be any available media that can be accessedby a general purpose or special purpose computer system.Computer-readable media that store computer-executable instructions arecomputer storage media (devices). Computer-readable media that carrycomputer-executable instructions are transmission media. Thus, by way ofexample, and not limitation, implementations of the disclosure cancomprise at least two distinctly different kinds of computer-readablemedia: computer storage media (devices) and transmission media.

Computer storage media (devices) includes RAM, ROM, EEPROM, CD-ROM,solid state drives (“SSDs”) (e.g., based on RAM), Flash memory,phase-change memory (“PCM”), other types of memory, other optical diskstorage, magnetic disk storage or other magnetic storage devices, or anyother medium which can be used to store desired program code means inthe form of computer-executable instructions or data structures andwhich can be accessed by a general purpose or special purpose computer.

An implementation of the devices, systems, and methods disclosed hereinmay communicate over a computer network. A “network” is defined as oneor more data links that enable the transport of electronic data betweencomputer systems and/or modules and/or other electronic devices. Wheninformation is transferred or provided over a network or anothercommunications connection (either hardwired, wireless, or a combinationof hardwired or wireless) to a computer, the computer properly views theconnection as a transmission medium. Transmissions media can include anetwork and/or data links, which can be used to carry desired programcode means in the form of computer-executable instructions or datastructures and which can be accessed by a general purpose or specialpurpose computer. Combinations of the above should also be includedwithin the scope of computer-readable media.

Computer-executable instructions comprise, for example, instructions anddata which, when executed at a processor, cause a general purposecomputer, special purpose computer, or special purpose processing deviceto perform a certain function or group of functions. The computerexecutable instructions may be, for example, binaries, intermediateformat instructions such as assembly language, or even source code.Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the described features or acts described above.Rather, the described features and acts are disclosed as example formsof implementing the claims.

Those skilled in the art will appreciate that the disclosure may bepracticed in network computing environments with many types of computersystem configurations, including, an in-dash vehicle computer, personalcomputers, desktop computers, laptop computers, message processors,hand-held devices, multi-processor systems, microprocessor-based orprogrammable consumer electronics, network PCs, minicomputers, mainframecomputers, mobile telephones, PDAs, tablets, pagers, routers, switches,various storage devices, and the like. The disclosure may also bepracticed in distributed system environments where local and remotecomputer systems, which are linked (either by hardwired data links,wireless data links, or by a combination of hardwired and wireless datalinks) through a network, both perform tasks. In a distributed systemenvironment, program modules may be located in both local and remotememory storage devices.

Further, where appropriate, functions described herein can be performedin one or more of: hardware, software, firmware, digital components, oranalog components. For example, one or more application specificintegrated circuits (ASICs) can be programmed to carry out one or moreof the systems and procedures described herein. Certain terms are usedthroughout the description and claims to refer to particular systemcomponents. As one skilled in the art will appreciate, components may bereferred to by different names. This document does not intend todistinguish between components that differ in name, but not function.

It should be noted that the sensor embodiments discussed above maycomprise computer hardware, software, firmware, or any combinationthereof to perform at least a portion of their functions. For example, asensor may include computer code configured to be executed in one ormore processors, and may include hardware logic/electrical circuitrycontrolled by the computer code. These example devices are providedherein purposes of illustration, and are not intended to be limiting.Embodiments of the present disclosure may be implemented in furthertypes of devices, as would be known to persons skilled in the relevantart(s).

At least some embodiments of the disclosure have been directed tocomputer program products comprising such logic (e.g., in the form ofsoftware) stored on any computer useable medium. Such software, whenexecuted in one or more data processing devices, causes a device tooperate as described herein.

While various embodiments of the present disclosure have been describedabove, it should be understood that they have been presented by way ofexample only, and not limitation. It will be apparent to persons skilledin the relevant art that various changes in form and detail can be madetherein without departing from the spirit and scope of the disclosure.Thus, the breadth and scope of the present disclosure should not belimited by any of the above-described exemplary embodiments, but shouldbe defined only in accordance with the following claims and theirequivalents. The foregoing description has been presented for thepurposes of illustration and description. It is not intended to beexhaustive or to limit the disclosure to the precise form disclosed.Many modifications and variations are possible in light of the aboveteaching. Further, it should be noted that any or all of theaforementioned alternate implementations may be used in any combinationdesired to form additional hybrid implementations of the disclosure.

The invention claimed is:
 1. A method comprising: monitoring, by a firstcomputing device, loading of a subject application instance of a bundledapplication executing in a first container on the first computingdevice, the bundled application including a plurality of applicationinstances executing on a plurality of computing devices, the subjectapplication instance executing on a subject computing device that is oneof the first computing device and a second computing device of theplurality of computing devices; (a) determining, by the first computingdevice, that loading of the subject application instance exceeds a firstthreshold condition; in response to (a), increasing, by the firstcomputing device, an allocation of processing cores to the firstcontainer; receiving, by a kernel executing on the subject computingdevice, a system call to retrieve a number of processors of the subjectcomputing device; intercepting, by the kernel, the system call; andreturning, by the kernel, in response to the system call, the allocationof processing cores to the first container.
 2. The method of claim 1,further comprising: in response to (a), increasing an allocation ofmemory to the first container.
 3. The method of claim 1, furthercomprising: (b) determining, by the first computing device, that loadingof the subject application instance is below a second thresholdcondition; and in response to (b), decreasing the allocation ofprocessing cores to the first container.
 4. The method of claim 1,further comprising: mounting, by the first computing device, a virtualfile system to the first container; and storing, by the subjectcomputing device, a virtual system resource file in the virtual filesystem; wherein increasing the allocation of processing cores to thefirst container comprises changing a number of processors stored in thevirtual system resource file.
 5. The method of claim 1, whereinincreasing, by the first computing device, the allocation of processingcores to the first container comprises: (b) determining, by the firstcomputing device, that the subject computing device does not haveavailable processing cores to permit increasing of the allocation; andin response to (b), transferring the first container from the subjectcomputing device to a third computing device.
 6. The method of claim 5,wherein transferring the first container from the subject computingdevice to the third computing device comprises: stopping the firstcontainer; creating a new container on the third computing device; andtransferring a state of the first container to the new container.
 7. Themethod of claim 6, wherein transferring the first container from thesubject computing device to the third computing device comprises:executing a pre-transfer hook with respect to the subject applicationinstance prior to stopping the first container, the pre-transfer hookbeing a first script; and executing a post-transfer hook with respect tothe subject application instance after transferring the state of thefirst container to the new container, the post-transfer hook being asecond script.
 8. The method of claim 1, further comprising: (b)determining, by the first computing device, that loading of the subjectapplication instance exceeds a second threshold condition; and inresponse to (b): creating a new container on a third computing device;and loading a copy of the subject application instance into the newcontainer.
 9. The method of claim 1, further comprising: (b)determining, by the first computing device, that loading of the subjectapplication instance is below a second threshold condition; and inresponse to (b), shutting down the first container.
 10. A systemcomprising: a first computing device programmed to: monitor loading of asubject application instance of a bundled application executing in afirst container on the first computing device, the bundled applicationincluding a plurality of application instances executing on a pluralityof computing devices, the subject application instance executing one asubject computing device that is one of the first computing device and asecond computing device of the plurality of computing devices; when (a)loading of the subject application instance exceeds a first thresholdcondition, increase, by the first computing device, an allocation ofprocessing cores to the first container; mount a virtual file system tothe first container; store a virtual system resource file in the virtualfile system; and increase the allocation of processing cores to thefirst container by changing a number of processors stored in the virtualsystem resource file.
 11. The system of claim 10, wherein the firstcomputing device is further programmed to: in response to (a), increasean allocation of memory to the first container.
 12. The system of claim10, wherein the first computing device is further programmed to: whenloading of the subject application instance is below a second thresholdcondition, decrease the allocation of processing cores to the firstcontainer.
 13. The system of claim 10, further comprising the subjectcomputing device, the subject computing device being further programmedto: receive, by a kernel executing on the subject computing device, asystem call to retrieve a number of processors of the subject computingdevice; intercept, by the kernel, the system call; and return, by thekernel, in response to the system call, the allocation of processingcores to the first container.
 14. The system of claim 10, wherein thefirst computing device is further programmed to increase the allocationof processing cores to the first container by: (b) determining, by thefirst computing device, that the subject computing device does not haveavailable processing cores to permit increasing of the allocation; andin response to (b), transferring the first container from the subjectcomputing device to a third computing device.
 15. The system of claim14, wherein the first computing device is further programmed to transferthe first container from the subject computing device to the thirdcomputing device by: stopping the first container; creating a newcontainer on the third computing device; and transferring a state of thefirst container to the new container.
 16. The system of claim 15,wherein the first computing device is further programmed to transfer thefirst container from the subject computing device to the third computingdevice by: executing a pre-transfer hook with respect to the subjectapplication instance prior to stopping the first container, thepre-transfer hook being a first script; and executing a post-transferhook with respect to the subject application instance after transferringthe state of the first container to the new container, the post-transferhook being a second script.
 17. The system of claim 10, wherein thefirst computing device is further programmed to: (b) determine thatloading of the subject application instance exceeds a second thresholdcondition; and in response to (b): create a new container on a thirdcomputing device; and load a copy of the subject application instanceinto the new container.
 18. The system of claim 10, wherein the firstcomputing device is further programmed to: (b) determine that loading ofthe subject application instance is below a second threshold condition;and in response to (b), shut down the first container.